-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile-Jvm
More file actions
11 lines (11 loc) · 796 Bytes
/
Copy pathDockerfile-Jvm
File metadata and controls
11 lines (11 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
FROM eclipse-temurin:25-jdk-alpine
VOLUME /tmp
ARG SPRING_PROFILE=prod
ENV MY_SPRING_PROFILE=$SPRING_PROFILE
ARG APP_FILE
ADD backend/${APP_FILE} /app.jar
# params for 2GB of container memory limit
ENV JAVA_OPTS="-XX:+UseG1GC -XX:MaxRAMPercentage=60 -XX:MaxGCPauseMillis=50 -XX:+UseStringDeduplication -XX:MaxDirectMemorySize=64m -XX:+ExitOnOutOfMemoryError"
# params for 1GB of container memory limit
# ENV JAVA_OPTS="-XX:+UseG1GC -XX:MaxRAMPercentage=50 -XX:MaxMetaspaceSize=128m -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:+UseStringDeduplication -XX:MaxDirectMemorySize=64m -XX:+ExitOnOutOfMemoryError"
ENTRYPOINT exec java $JAVA_OPTS -DspringAot=true -Dspring.profiles.active=$MY_SPRING_PROFILE -Dliquibase.duplicateFileMode=WARN -Djava.security.egd=file:/dev/./urandom -jar /app.jar