-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
42 lines (37 loc) · 1.25 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
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}"
EXPOSE 8080
EXPOSE 9010
EXPOSE 9020
EXPOSE 4321
ENV _JAVA_OPTIONS "-Xms128m -Xmx256m -Djava.awt.headless=true"
ENTRYPOINT [ \
"/bin/bash", \
"-c", \
"exec /usr/bin/java \
-XX:MaxRAM=$(( $(cat /sys/fs/cgroup/memory/memory.limit_in_bytes) - 254*1024*1024 )) \
-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 \
-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