Skip to content

Commit

Permalink
build: non-root- & docker jvm options (#202)
Browse files Browse the repository at this point in the history
* build: non-root & jvm opts docker

* bump: version to 2.4.4
  • Loading branch information
laurentC35 authored Aug 7, 2024
1 parent e6aa1a9 commit 1e485f6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
FROM eclipse-temurin:17-jre

ENV PATH_TO_JAR=/opt/eno-ws/eno-ws.jar
WORKDIR /opt/eno-ws/
COPY ./target/*.jar /opt/eno-ws/eno-ws.jar
ENTRYPOINT ["java", "-jar", "/opt/eno-ws/eno-ws.jar"]
ADD ./target/*.jar $PATH_TO_JAR

ENV JAVA_TOOL_OPTIONS_DEFAULT \
-XX:MaxRAMPercentage=75 \
-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\"; \
exec java -jar $PATH_TO_JAR" ]
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<groupId>fr.insee</groupId>
<artifactId>eno-ws</artifactId>
<packaging>jar</packaging>
<version>2.4.3</version>
<version>2.4.4</version>
<name>Eno-Web-Service</name>

<properties>
Expand Down

0 comments on commit 1e485f6

Please sign in to comment.