Skip to content

Commit

Permalink
fix: resolve docker memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
davdarras authored and EricThuaud committed Oct 10, 2024
1 parent dcf9fd8 commit 2e3c55b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions queen-application/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM eclipse-temurin:21.0.3_9-jre-alpine

ENV PATH_TO_JAR=/opt/app/app.jar
WORKDIR /opt/app/
COPY ./target/*.jar /opt/app/app.jar
COPY ./target/*.jar $PATH_TO_JAR

ENV JAVA_TOOL_OPTIONS_DEFAULT \
-XX:MaxRAMPercentage=75

# Setup a non-root user context (security)
RUN addgroup -g 1000 tomcatgroup
Expand All @@ -11,4 +15,6 @@ RUN chown -R 1000:1000 /opt/app

USER 1000

ENTRYPOINT ["java", "-jar", "/opt/app/app.jar"]
ENTRYPOINT [ "/bin/sh", "-c", \
"export JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS_DEFAULT $JAVA_TOOL_OPTIONS\"; \
exec java -jar $PATH_TO_JAR" ]

0 comments on commit 2e3c55b

Please sign in to comment.