Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow EXTRA_JAVA_OPTS to be configured at runtime #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ ENV WEBAPP_CONTEXT=geoserver
# --add-opens=java.desktop/sun.java2d.pipe=ALL-UNNAMED

# see https://docs.geoserver.org/stable/en/user/production/container.html
ENV CATALINA_OPTS="\$EXTRA_JAVA_OPTS \
# `EXTRA_JAVA_OPTS` will be prepended during runtime by startup.sh
ENV CATALINA_OPTS=" \
--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The ``startup.sh`` script allows some customization on startup:
* ``CORS_ALLOWED_HEADERS`` (default ``Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers``)
* ``CORS_ALLOW_CREDENTIALS`` (default ``false``) **Setting this to ``true`` will only have the desired effect if ``CORS_ALLOWED_ORIGINS`` defines explicit origins (not ``*``)**
* ``PROXY_BASE_URL`` to the base URL of the GeoServer web app if GeoServer is behind a proxy. Example: ``https://example.com/geoserver``.
* ``EXTRA_JAVA_OPTS`` to pass params to the JAVA environment.

The CORS variables customize tomcat's `web.xml` file. If you need more customization,
you can provide your own customized `web.xml` file to tomcat by mounting it into the container
Expand Down
3 changes: 3 additions & 0 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ if [ "${HTTPS_ENABLED}" = "true" ]; then
envsubst < "${CONFIG_DIR}"/server-https.xml > "${CATALINA_HOME}/conf/server.xml"
fi

# Add configurable runtime options via EXTRA_JAVA_OPTS
export CATALINA_OPTS="${EXTRA_JAVA_OPTS} ${CATALINA_OPTS}"

# start the tomcat
# CIS - Tomcat Benchmark recommendations:
# * Turn off session facade recycling
Expand Down