diff --git a/Dockerfile b/Dockerfile index e566d8998..f4809dc50 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,20 @@ -FROM eclipse-temurin:21.0.3_9-jre +FROM eclipse-temurin:21.0.4_7-jre + +ENV PATH_TO_JAR=/opt/eno-ws/eno-ws.jar WORKDIR /opt/eno-ws/ -COPY ./eno-ws/build/libs/*.jar /opt/eno-ws/eno-ws.jar -EXPOSE 8080 +ADD ./eno-ws/build/libs/*.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" -RUN addgroup eno -RUN useradd -g eno eno -USER eno +USER $JAVA_USER_ID -ENTRYPOINT ["java", "-jar", "/opt/eno-ws/eno-ws.jar"] +ENTRYPOINT [ "/bin/sh", "-c", \ + "export JAVA_TOOL_OPTIONS=\"$JAVA_TOOL_OPTIONS_DEFAULT $JAVA_TOOL_OPTIONS\"; \ + exec java -jar $PATH_TO_JAR" ] diff --git a/build.gradle b/build.gradle index 86b611f63..f787713c0 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ tasks.withType(JavaCompile).configureEach { allprojects { group = 'fr.insee.eno' - version = '3.24.0' + version = '3.24.1' } subprojects {