summaryrefslogtreecommitdiffstats
path: root/components/bbs-event-processor/Dockerfile
blob: e799bd92a3c8ec96ec6d22aa26768095bee67c1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM openjdk:8-jre-alpine

ARG PROJECT_BUILD_DIR_NAME
ARG FINAL_JAR
ARG DEPENDENCIES_DIR
ARG DOCKER_ARTIFACT_DIR

#Add a new user and group to allow container to be run as non-root
RUN addgroup -S bbs-ep && adduser -S -G bbs-ep bbs-ep

#Copy dependencies and executable jar
WORKDIR ${DOCKER_ARTIFACT_DIR}
COPY ${PROJECT_BUILD_DIR_NAME}/${FINAL_JAR} .
#Overcome Docker limitation to put ARG inside ENTRYPOINT
RUN ln -s ${FINAL_JAR} bbs-ep.jar
COPY ${PROJECT_BUILD_DIR_NAME}/${DEPENDENCIES_DIR} ./${DEPENDENCIES_DIR}

EXPOSE 8100

USER bbs-ep:bbs-ep
ENTRYPOINT ["java", "-jar", "bbs-ep.jar"]