-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (41 loc) · 1.46 KB
/
Dockerfile
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
FROM amazoncorretto:8u382
ARG JAR_LIBS
ARG JAR_FILE
ARG VERSION
ARG BUILD
ARG SERVICE_NAME
LABEL "com.ubirch.service"="${SERVICE_NAME}"
LABEL "com.ubirch.version"="${VERSION}"
LABEL "com.ubirch.build"="${BUILD}"
# for readiness and liveness probe
EXPOSE 9010
# for debugging
EXPOSE 9020
# for prometheus metrics
EXPOSE 4321
COPY src/certs/truststore-prod.jks /usr/share/service/lib/truststore-prod.jks
COPY src/certs/truststore-devtest.jks /usr/share/service/lib/truststore-devtest.jks
ENTRYPOINT [ \
"/bin/bash", \
"-c", \
"exec /usr/bin/java \
-XX:MaxRAM=$(( $(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) - 254*1024*1024 )) \
-XX:+ExitOnOutOfMemoryError \
-Djava.awt.headless=true \
-Djava.security.egd=file:/dev/./urandom \
-Djava.rmi.server.hostname=localhost \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9010 \
-Dcom.sun.management.jmxremote.rmi.port=9010 \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Dconfig.resource=application-docker.conf \
-Dlogback.configurationFile=logback-docker.xml \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9020 \
$EVTL_JAVA_OPTS -jar /usr/share/service/main.jar" \
]
# Add Maven dependencies (not shaded into the artifact; Docker-cached)
COPY ${JAR_LIBS} /usr/share/service/lib
# Add the service itself
COPY ${JAR_FILE} /usr/share/service/main.jar