Skip to content

Commit d7a8c8a

Browse files
author
wlanboy
committed
moved entrypoint
1 parent 7e0efff commit d7a8c8a

File tree

3 files changed

+48
-50
lines changed

3 files changed

+48
-50
lines changed

Dockerfile

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,30 @@ COPY --from=build --chown=185:185 /app/app.jsa /app/app.jsa
9191
COPY --chown=185:185 containerconfig/application.properties /app/config/application.properties
9292
# → Externe Konfiguration ins Config-Verzeichnis für die Referenz für ENV Vars
9393

94-
COPY --chown=185:185 entrypoint.sh /app/entrypoint.sh
95-
# → Custom Entrypoint für Java OPTS.
96-
9794
EXPOSE 8080
9895
# → Dokumentiert den Port, den die App verwendet (Spring Boot Default).
9996

100-
ENTRYPOINT ["/app/entrypoint.sh"]
101-
# → Startet die App über das Entry-Skript.
102-
# → Vorteil: Skript kann Umgebungsvariablen verarbeiten, ENTRYPOINT nicht.
97+
# Wir nutzen exec, damit Java die PID 1 übernimmt.
98+
# Dies ist wichtig für das Signal-Handling (z.B. in Kubernetes).
99+
# exec ersetzt den aktuellen Shell-Prozess durch den Java-Prozess.
100+
101+
# JVM-Optionen:
102+
# -Djava.security.egd: Beschleunigt kryptografische Initialisierung
103+
# -XX:MaxRAMPercentage=50: Java nutzt max 50% des Container-RAMs
104+
# -XX:InitialRAMPercentage=30: Startet mit 30% RAM (schnellerer Startup)
105+
# -XX:+UseG1GC: G1 Garbage Collector für niedrige Latenz
106+
# -XX:MaxGCPauseMillis=200: Zielwert für GC-Pause
107+
# -XX:+ExplicitGCInvokesConcurrent: System.gc() läuft parallel
108+
# -XX:+ExitOnOutOfMemoryError: JVM beendet bei OOM (Kubernetes kann neustarten)
109+
ENTRYPOINT ["java", \
110+
"-XX:SharedArchiveFile=/app/app.jsa", \
111+
"-Dspring.aot.enabled=true", \
112+
"-Djava.security.egd=file:/dev/./urandom", \
113+
"-XX:MaxRAMPercentage=50", \
114+
"-XX:InitialRAMPercentage=30", \
115+
"-XX:+UseG1GC", \
116+
"-XX:MaxGCPauseMillis=200", \
117+
"-XX:+ExplicitGCInvokesConcurrent", \
118+
"-XX:+ExitOnOutOfMemoryError", \
119+
"-Dspring.config.location=file:/app/config/application.properties", \
120+
"org.springframework.boot.loader.launch.JarLauncher"]

Dockerfile25

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,30 @@ COPY --from=build --chown=185:185 /app/app.jsa /app/app.jsa
9191
COPY --chown=185:185 containerconfig/application.properties /app/config/application.properties
9292
# → Externe Konfiguration ins Config-Verzeichnis für die Referenz für ENV Vars
9393

94-
COPY --chown=185:185 entrypoint.sh /app/entrypoint.sh
95-
# → Custom Entrypoint für Java OPTS.
96-
9794
EXPOSE 8080
9895
# → Dokumentiert den Port, den die App verwendet (Spring Boot Default).
9996

100-
ENTRYPOINT ["/app/entrypoint.sh"]
101-
# → Startet die App über das Entry-Skript.
102-
# → Vorteil: Skript kann Umgebungsvariablen verarbeiten, ENTRYPOINT nicht.
97+
# Wir nutzen exec, damit Java die PID 1 übernimmt.
98+
# Dies ist wichtig für das Signal-Handling (z.B. in Kubernetes).
99+
# exec ersetzt den aktuellen Shell-Prozess durch den Java-Prozess.
100+
101+
# JVM-Optionen:
102+
# -Djava.security.egd: Beschleunigt kryptografische Initialisierung
103+
# -XX:MaxRAMPercentage=50: Java nutzt max 50% des Container-RAMs
104+
# -XX:InitialRAMPercentage=30: Startet mit 30% RAM (schnellerer Startup)
105+
# -XX:+UseG1GC: G1 Garbage Collector für niedrige Latenz
106+
# -XX:MaxGCPauseMillis=200: Zielwert für GC-Pause
107+
# -XX:+ExplicitGCInvokesConcurrent: System.gc() läuft parallel
108+
# -XX:+ExitOnOutOfMemoryError: JVM beendet bei OOM (Kubernetes kann neustarten)
109+
ENTRYPOINT ["java", \
110+
"-XX:SharedArchiveFile=/app/app.jsa", \
111+
"-Dspring.aot.enabled=true", \
112+
"-Djava.security.egd=file:/dev/./urandom", \
113+
"-XX:MaxRAMPercentage=50", \
114+
"-XX:InitialRAMPercentage=30", \
115+
"-XX:+UseG1GC", \
116+
"-XX:MaxGCPauseMillis=200", \
117+
"-XX:+ExplicitGCInvokesConcurrent", \
118+
"-XX:+ExitOnOutOfMemoryError", \
119+
"-Dspring.config.location=file:/app/config/application.properties", \
120+
"org.springframework.boot.loader.launch.JarLauncher"]

entrypoint.sh

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)