Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
FROM amazoncorretto:21
COPY build/libs/*SNAPSHOT.war app.war

ENTRYPOINT [
"java",
"-Duser.timezone=GMT+9",
"-Djava.security.egd=file:/dev/./urandom",
"-XX:+UseG1GC",
"-XX:MaxGCPauseMillis=100",
"-Xms2g",
"-Xmx2g",
"-jar", "/app.war"
]
ENV JAVA_OPTS="-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -Xms2g -Xmx2g"
ENTRYPOINT ["sh", "-c", "exec java -Duser.timezone=GMT+9 $JAVA_OPTS -jar /app.war"]
Comment on lines +4 to +5

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

JAVA_OPTS 환경 변수를 도입하여 JVM 옵션을 외부에서 주입할 수 있도록 변경한 점은 좋은 개선입니다. 다만, 일관성을 위해 -Duser.timezone=GMT+9 옵션도 JAVA_OPTS에 포함하는 것이 더 좋을 것 같습니다. 이렇게 하면 모든 JVM 관련 설정을 한 곳에서 관리하고 오버라이드할 수 있어 유지보수성이 향상됩니다.

ENV JAVA_OPTS="-Duser.timezone=GMT+9 -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -Xms2g -Xmx2g"
ENTRYPOINT ["sh", "-c", "exec java $JAVA_OPTS -jar /app.war"]