feat: allow use of custom server.xml

pull/39/head
Nils Bühner 2024-02-07 14:29:46 +01:00
parent 9ff2eb405e
commit 4a68744113
2 changed files with 10 additions and 2 deletions

View File

@ -122,8 +122,6 @@ RUN rm -rf /tmp/*
# Add default configs
COPY config $CONFIG_DIR
COPY config/server.xml $CATALINA_HOME/conf/server.xml
# Apply CIS Apache tomcat recommendations regarding server information
# * Alter the advertised server.info String (2.1 - 2.3)
RUN cd $CATALINA_HOME/lib \

View File

@ -111,6 +111,16 @@ if [ "${POSTGRES_JNDI_ENABLED}" = "true" ]; then
fi
fi
# Use a custom "server.xml" if the user mounted one into the container
if [ -d "${CONFIG_OVERRIDES_DIR}" ] && [ -f "${CONFIG_OVERRIDES_DIR}/server.xml" ]; then
echo "Installing configuration override for server.xml with substituted environment variables"
envsubst < "${CONFIG_OVERRIDES_DIR}"/server.xml > "${CATALINA_HOME}/conf/server.xml"
else
# Otherwise use the default
echo "Installing default server.xml with substituted environment variables"
envsubst < "${CONFIG_DIR}"/server.xml > "${CATALINA_HOME}/conf/server.xml"
fi
# start the tomcat
# CIS - Tomcat Benchmark recommendations:
# * Turn off session facade recycling