Skip to content

Commit

Permalink
feat: add JVM default options (#1087)
Browse files Browse the repository at this point in the history
* feat: add JVM default options

* build: user path_to_jar env variable

* build: use ZGC instead of ParallelGC

* build; change user of docker img

* bump: version to 3.24.1

* build: fix sonar lint
  • Loading branch information
laurentC35 authored Aug 7, 2024
1 parent d1a3b30 commit d112d7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tasks.withType(JavaCompile).configureEach {

allprojects {
group = 'fr.insee.eno'
version = '3.24.0'
version = '3.24.1'
}

subprojects {
Expand Down

0 comments on commit d112d7b

Please sign in to comment.