blob: e799bd92a3c8ec96ec6d22aa26768095bee67c1c [file] [log] [blame]
Stavros Kanarakisf6668af2019-04-22 18:41:18 +03001FROM openjdk:8-jre-alpine
2
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
9RUN addgroup -S bbs-ep && adduser -S -G bbs-ep bbs-ep
10
11#Copy dependencies and executable jar
12WORKDIR ${DOCKER_ARTIFACT_DIR}
13COPY ${PROJECT_BUILD_DIR_NAME}/${FINAL_JAR} .
14#Overcome Docker limitation to put ARG inside ENTRYPOINT
15RUN ln -s ${FINAL_JAR} bbs-ep.jar
16COPY ${PROJECT_BUILD_DIR_NAME}/${DEPENDENCIES_DIR} ./${DEPENDENCIES_DIR}
17
18EXPOSE 8100
19
20USER bbs-ep:bbs-ep
21ENTRYPOINT ["java", "-jar", "bbs-ep.jar"]