Skip to content

Commit 172cfd4

Browse files
committed
Move context logic to entrypoint, remove context script
1 parent b768be2 commit 172cfd4

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ ARG TINI_VERSION=v0.18.0
2424
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
2525
RUN chmod +x /tini
2626

27-
COPY scripts/context.sh /context.sh
2827
COPY entrypoint.sh /entrypoint.sh
2928

3029
ENV CROWD_VERSION 3.4.5
@@ -35,5 +34,3 @@ RUN mkdir -p ${CROWD_INSTALL_DIR} \
3534
&& chown -R ${RUN_USER}:${RUN_GROUP} ${CROWD_INSTALL_DIR}/ \
3635
&& sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dcrowd.home=\${CROWD_HOME}/g' ${CROWD_INSTALL_DIR}/apache-tomcat/bin/setenv.sh \
3736
&& sed -i -e 's/port="8095"/port="8095" secure="${catalinaConnectorSecure}" scheme="${catalinaConnectorScheme}" proxyName="${catalinaConnectorProxyName}" proxyPort="${catalinaConnectorProxyPort}"/' ${CROWD_INSTALL_DIR}/apache-tomcat/conf/server.xml
38-
39-
RUN /context.sh

entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ CATALINA_OPTS="${CATALINA_OPTS} -DcatalinaContextPath=${CATALINA_CONTEXT_PATH}"
1818

1919
export CATALINA_OPTS
2020

21+
# Set the Tomcat context
22+
if [ -z "$CATALINA_CONTEXT_PATH" ];
23+
then
24+
mv ${CROWD_INSTALL_DIR}/apache-tomcat/conf/Catalina/localhost/crowd.xml ${CROWD_INSTALL_DIR}/apache-tomcat/conf/Catalina/localhost/ROOT.xml
25+
else
26+
if [ "$CATALINA_CONTEXT_PATH" == "crowd" ];
27+
then
28+
echo "Context is default. Skipping..."
29+
else
30+
mv ${CROWD_INSTALL_DIR}/apache-tomcat/conf/Catalina/localhost/crowd.xml ${CROWD_INSTALL_DIR}/apache-tomcat/conf/Catalina/localhost/${CATALINA_CONTEXT_PATH}.xml
31+
fi
32+
fi
33+
2134

2235
# Start Crowd as the correct user
2336
if [ "${UID}" -eq 0 ]; then

scripts/context.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)