@@ -204,8 +204,14 @@ if [[ ${POSTGRES_JNDI} =~ [Tt][Rr][Uu][Ee] ]];then
204
204
if [ " $POSTGRES_JAR_COUNT " != 0 ]; then
205
205
rm " ${CATALINA_HOME} " /webapps/geoserver/WEB-INF/lib/postgresql-*
206
206
fi
207
- cp " ${CATALINA_HOME} " /postgres_config/postgresql-* " ${CATALINA_HOME} " /lib/ &&
208
- envsubst < /build_data/context.xml > " ${CATALINA_HOME} " /conf/context.xml
207
+ cp " ${CATALINA_HOME} " /postgres_config/postgresql-* " ${CATALINA_HOME} " /lib/
208
+ if [[ -f ${EXTRA_CONFIG_DIR} /context.xml ]]; then
209
+ envsubst < " ${EXTRA_CONFIG_DIR} " /context.xml > " ${CATALINA_HOME} " /conf/context.xml
210
+ else
211
+ # default values
212
+ envsubst < /build_data/context.xml > " ${CATALINA_HOME} " /conf/context.xml
213
+ fi
214
+
209
215
else
210
216
cp " ${CATALINA_HOME} " /postgres_config/postgresql-* " ${CATALINA_HOME} " /webapps/geoserver/WEB-INF/lib/
211
217
fi
@@ -216,8 +222,12 @@ if [[ "${TOMCAT_EXTRAS}" =~ [Tt][Rr][Uu][Ee] ]]; then
216
222
cp -r /tmp/tomcat_apps/webapps.dist/* " ${CATALINA_HOME} " /webapps/ &&
217
223
rm -r /tmp/tomcat_apps
218
224
if [[ ${POSTGRES_JNDI} =~ [Ff][Aa][Ll][Ss][Ee] ]]; then
219
- cp /build_data/context.xml " ${CATALINA_HOME} " /webapps/manager/META-INF/
220
- sed -i -e ' 19,36d' " ${CATALINA_HOME} " /webapps/manager/META-INF/context.xml
225
+ if [[ -f ${EXTRA_CONFIG_DIR} /context.xml ]]; then
226
+ envsubst < ${EXTRA_CONFIG_DIR} /context.xml > " ${CATALINA_HOME} " /webapps/manager/META-INF/context.xml
227
+ else
228
+ cp /build_data/context.xml " ${CATALINA_HOME} " /webapps/manager/META-INF/
229
+ sed -i -e ' 19,36d' " ${CATALINA_HOME} " /webapps/manager/META-INF/context.xml
230
+ fi
221
231
fi
222
232
if [[ -z ${TOMCAT_PASSWORD} ]]; then
223
233
generate_random_string 18
0 commit comments