From 00789e58322b1b5bcaf81838f984ff8288c6b164 Mon Sep 17 00:00:00 2001 From: ACX <8075870+acx10@users.noreply.github.com> Date: Fri, 27 Feb 2026 00:00:28 -0700 Subject: [PATCH] tune jvm flags for containerized deployments (#3063) --- Dockerfile | 2 +- Dockerfile.ci | 2 +- example-docker/docker-compose.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 09e38e419..d5e2eba59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,7 @@ LABEL org.opencontainers.image.title="BookLore" \ org.opencontainers.image.licenses="GPL-3.0" \ org.opencontainers.image.base.name="docker.io/library/eclipse-temurin:25-jre-alpine" -ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+UseStringDeduplication -XX:+UseContainerSupport -XX:+UseCompactObjectHeaders -XX:MaxRAMPercentage=75.0" +ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication -XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError" ARG TARGETARCH RUN apk update && apk add --no-cache su-exec libstdc++ libgcc && \ diff --git a/Dockerfile.ci b/Dockerfile.ci index ee66725c7..b4dc8c736 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -16,7 +16,7 @@ LABEL org.opencontainers.image.title="BookLore" \ org.opencontainers.image.licenses="GPL-3.0" \ org.opencontainers.image.base.name="docker.io/library/eclipse-temurin:25-jre-alpine" -ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+UseStringDeduplication -XX:+UseContainerSupport -XX:+UseCompactObjectHeaders -XX:MaxRAMPercentage=75.0" +ENV JAVA_TOOL_OPTIONS="-XX:+UseG1GC -XX:+UseCompactObjectHeaders -XX:+UseStringDeduplication -XX:MaxRAMPercentage=75.0 -XX:+ExitOnOutOfMemoryError" ARG TARGETARCH RUN apk update && apk add --no-cache su-exec libstdc++ libgcc diff --git a/example-docker/docker-compose.yml b/example-docker/docker-compose.yml index d7334bbc8..26302777a 100644 --- a/example-docker/docker-compose.yml +++ b/example-docker/docker-compose.yml @@ -15,6 +15,7 @@ services: - SWAGGER_ENABLED=false # Enable or disable Swagger UI (API docs). Set to 'true' to allow access; 'false' to block access (recommended for production). - FORCE_DISABLE_OIDC=false # Set to 'true' to force-disable OIDC and allow internal login, regardless of UI config # ALLOWED_ORIGINS= # Comma-separated list of allowed cross-origin URLs for CORS (e.g. https://app.example.com). Defaults to '*' (allow all) if unset. Leave empty to restrict to same-origin. + # JAVA_TOOL_OPTIONS=-XX:+UseSerialGC -Xmx256m -XX:+UseCompactObjectHeaders -XX:+ExitOnOutOfMemoryError # For very constrained hardware (RPi 3, 512MB RAM). Uncomment and adjust as needed. depends_on: mariadb: condition: service_healthy