generated from shubhambhattar/spring-boot-monitoring-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (24 loc) · 1.12 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
FROM openjdk:21.0.1_12-jre-jammy
RUN [ "groupadd", "--system", "spring-boot" ]
RUN [ "useradd", "--system", "--gid", "spring-boot", "spring-boot-user" ]
USER spring-boot-user
# Configuration
ENV JAVA_TOOL_OPTIONS="-XX:+PrintFlagsFinal \
-XX:+UseContainerSupport \
-XX:MaxRAMPercentage=60.0 \
-XX:+UseG1GC \
-XX:+HeapDumpOnOutOfMemoryError \
-Dhost.name=localhost \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9004 \
-Dcom.sun.management.jmxremote.rmi.port=9004 \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Dfile.encoding=UTF8 \
-Djava.rmi.server.hostname=localhost"
# JMX Port and Application port
EXPOSE 9004 8080
COPY [ "target/demo.jar", "/app/" ]
ENTRYPOINT [ "java", "-jar" ]
CMD [ "/app/demo.jar" ]