Skip to content

chore: add required java parameters + fix JAVA_OPTIONS #741

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

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
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MAINTAINER geosolutions<[email protected]>
RUN mkdir -p /docker-entrypoint.d
# Tomcat specific options
ENV CATALINA_BASE "$CATALINA_HOME"
ENV JAVA_OPTS="${JAVA_OPTS} -XX:MaxRAMPercentage=80 -XX:+UseParallelGC ${JAVA_OPTIONS}"
ENV JAVA_OPTS="${JAVA_OPTS} -XX:MaxRAMPercentage=80 -XX:+UseParallelGC"

# Optionally remove Tomcat manager, docs, and examples
ARG TOMCAT_EXTRAS=false
Expand All @@ -37,7 +37,9 @@ USER tomcat
# COPY docker/geostore-datasource-ovr.properties "${CATALINA_BASE}/conf/"
# ARG GEOSTORE_OVR_OPT=""
ARG GEORCHESTRA_DATADIR_OPT="-Dgeorchestra.datadir=/etc/georchestra"
ENV JAVA_OPTS="${JAVA_OPTS} ${GEORCHESTRA_DATADIR_OPT}"
# geOrchestra required parameters for mapstore-geOrchestra to function properly
ARG GEORCHESTRA_REQUIRED_OPTS="-DPRINT_BASE_URL=pdf -Dgeorchestra.extensions=/mnt/mapstore_extensions"
ENV JAVA_OPTS="${JAVA_OPTS} ${GEORCHESTRA_DATADIR_OPT} ${GEORCHESTRA_REQUIRED_OPTS}"

# Set variable to better handle terminal commands
ENV TERM xterm
Expand Down
12 changes: 12 additions & 0 deletions georchestra-docker-scripts/99-apply-java-options.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# JAVA_OPTIONS gives the ability to add more parameters to JAVA_OPTS at runtime.

# Exit immediately if a command exits with a non-zero status.
set -e

# Check if JAVA_OPTIONS is set and not empty
if [ -n "$JAVA_OPTIONS" ]; then
echo "Applying runtime JAVA_OPTIONS: $JAVA_OPTIONS"
# Append JAVA_OPTIONS to JAVA_OPTS
export JAVA_OPTS="${JAVA_OPTS} $JAVA_OPTIONS"
fi
Loading