forked from sncf-connect-tech/hesperides
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (38 loc) · 1.61 KB
/
Dockerfile
File metadata and controls
47 lines (38 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM maven:3-jdk-8-alpine
WORKDIR /usr/local/src
COPY pom.xml .
COPY bootstrap bootstrap
COPY commons commons
COPY core core
COPY tests tests
COPY pom.xml .
RUN mvn clean package -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
FROM openjdk:8-jre-alpine
RUN apk add curl mongodb
# We only need the MongoDB shell:
RUN rm /etc/init.d/mongo* /etc/conf.d/mongo* /usr/bin/mongod /usr/bin/mongos /etc/logrotate.d/mongodb /usr/bin/install_compass
COPY --from=0 /usr/local/src/bootstrap/target/hesperides-*.jar hesperides.jar
COPY mongo_create_collections.js /
COPY docker_entrypoint.sh /
RUN chmod u+x /docker_entrypoint.sh
ARG BUILD_TIME
ENV BUILD_TIME=$BUILD_TIME
ARG GIT_BRANCH
ENV GIT_BRANCH=$GIT_BRANCH
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
ARG GIT_COMMIT_MSG
ENV GIT_COMMIT_MSG=$GIT_COMMIT_MSG
ARG GIT_TAG
ENV GIT_TAG=$GIT_TAG
ENV SENTRY_TAGS=GIT_BRANCH:$GIT_BRANCH,GIT_COMMIT:$GIT_COMMIT,GIT_TAG:$GIT_TAG
ENTRYPOINT ["/docker_entrypoint.sh"]
EXPOSE 8080
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD curl --fail http://localhost:8080/rest/manage/health || exit 1
# -XX:+ExitOnOutOfMemoryError : an OutOfMemoryError will often leave the JVM in an inconsistent state. Terminating the JVM will allow it to be restarted by an external process manager
# -XX:+HeapDumpOnOutOfMemoryError : get a heap dump when the app crashes
# -XX:-OmitStackTraceInFastThrow : avoid missing stacktraces cf. https://plumbr.io/blog/java/on-a-quest-for-missing-stacktraces
CMD /usr/bin/java $JAVA_OPTS \
-XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow \
-Xms2g -Xmx4g \
-jar /hesperides.jar