Last active
August 12, 2022 20:39
-
-
Save ghusta/12b50687a39bd02a88680df450a840f4 to your computer and use it in GitHub Desktop.
Tomcat 8 + Docker : add custom directory in classpath (Method #1 : modify conf/catalina.properties)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM tomcat:8.5-jre8 | |
# $CATALINA_HOME is defined in tomcat image | |
ADD target/my-webapp*.war $CATALINA_HOME/webapps/my-webapp.war | |
# Application config | |
RUN mkdir $CATALINA_HOME/app_conf/ | |
ADD src/main/config/test.properties $CATALINA_HOME/app_conf/ | |
# Modify property 'shared.loader' in catalina.properties | |
RUN sed -i -e 's/^shared.loader=$/shared.loader="${catalina.base}\/app_conf"/' $CATALINA_HOME/conf/catalina.properties | |
# Check : docker exec my-webapp cat /usr/local/tomcat/conf/catalina.properties |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this. Saved me a lot of time!!