Skip to content

Commit

Permalink
FEAT : ajout démarrage jstat
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-maraval committed Nov 29, 2024
1 parent 38b7d90 commit 204a16f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ COPY --from=build-image /build/target/sudoc.jar /app/sudoc.jar
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY ./docker/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./docker/jstatd.all.policy /app/jstatd.all.policy
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
13 changes: 12 additions & 1 deletion docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/bash

export HOSTNAME=${HOSTNAME}
java -XX:MaxRAMPercentage=75 -XX:+UseG1GC -XX:ConcGCThreads=5 -XX:+ExitOnOutOfMemoryError -XX:MaxGCPauseMillis=100 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=${HOSTNAME} -jar /app/sudoc.jar

echo "Démarrage de jstatd..."
jstatd -J-Djava.security.policy=/app/jstatd.all.policy -p 1099 &
JSTATD_PID=$!

echo "Démarrage de l'application Java..."
java -XX:MaxRAMPercentage=75 -XX:+UseG1GC -XX:ConcGCThreads=5 -XX:+ExitOnOutOfMemoryError -XX:MaxGCPauseMillis=100 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=${HOSTNAME} -jar /app/sudoc.jar
JAVA_APP_PID=$!

# Attendre que les processus se terminent
wait $JAVA_APP_PID
kill $JSTATD_PID
3 changes: 3 additions & 0 deletions docker/jstatd.all.policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};

0 comments on commit 204a16f

Please sign in to comment.