blob: a9e6a8988eb2a2d17ca3e2013b1bdb9fa8cf14ef [file] [log] [blame]
Stavros Kanarakis22025d42020-02-28 21:53:04 +02001FROM openjdk:11-jre-slim
Stavros Kanarakisf6668af2019-04-22 18:41:18 +03002
3ARG PROJECT_BUILD_DIR_NAME
4ARG FINAL_JAR
5ARG DEPENDENCIES_DIR
6ARG DOCKER_ARTIFACT_DIR
7
8#Add a new user and group to allow container to be run as non-root
Stavros Kanarakis22025d42020-02-28 21:53:04 +02009RUN addgroup --system bbs-ep && adduser --system --ingroup bbs-ep bbs-ep
Stavros Kanarakisf6668af2019-04-22 18:41:18 +030010
11#Copy dependencies and executable jar
12WORKDIR ${DOCKER_ARTIFACT_DIR}
13COPY ${PROJECT_BUILD_DIR_NAME}/${FINAL_JAR} .
Stavros Kanarakis22025d42020-02-28 21:53:04 +020014COPY KeyStore.jks .
15COPY KeyStorePass.txt .
16
Stavros Kanarakisf6668af2019-04-22 18:41:18 +030017#Overcome Docker limitation to put ARG inside ENTRYPOINT
18RUN ln -s ${FINAL_JAR} bbs-ep.jar
19COPY ${PROJECT_BUILD_DIR_NAME}/${DEPENDENCIES_DIR} ./${DEPENDENCIES_DIR}
20
21EXPOSE 8100
22
23USER bbs-ep:bbs-ep
24ENTRYPOINT ["java", "-jar", "bbs-ep.jar"]