Skip to content

Commit

Permalink
build: make dockerfile non-root & UseZGC
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentC35 committed Aug 7, 2024
1 parent 135f759 commit df87351
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ FROM eclipse-temurin:21.0.4_7-jre

ENV LANG=fr_FR.UTF-8 LANGUAGE=fr_FR:fr LC_ALL=fr_FR.UTF-8

ENV PATH_TO_JAR=/application/pe-bo.jar
WORKDIR application
RUN rm -rf /application
ENV PATH_TO_JAR=/opt/pe/pe-bo.jar
WORKDIR /opt/pe/
ADD ./target/*.jar $PATH_TO_JAR

ENV JAVA_TOOL_OPTIONS_DEFAULT \
-XX:MaxRAMPercentage=75 \
-XX:+UseParallelGC
-XX:+UseZGC

ENV JAVA_USER_ID=10001
ENV JAVA_USER=java
RUN groupadd -g "$JAVA_USER_ID" "$JAVA_USER" && \
useradd -r -u "$JAVA_USER_ID" -g "$JAVA_USER" "$JAVA_USER"

USER $JAVA_USER_ID

ENTRYPOINT [ "/bin/sh", "-c", \
"export JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS_DEFAULT $JAVA_TOOL_OPTIONS\"; \
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>fr.insee</groupId>
<artifactId>public-enemy-api</artifactId>
<version>2.3.8</version>
<version>2.3.9</version>
<packaging>jar</packaging>

<name>public-enemy-api</name>
Expand Down

0 comments on commit df87351

Please sign in to comment.