add external application.properties file to a dockerized spring boot web app inside tomcat

Viewed 7546

I have a docker image of tomcat with my spring boot web app inside tomcat /webapps folder. The app has its own application.properties file packed in the folder. I want to give the option for anyone running the docker image to mount it's own external application.properties file for the spring boot web app to run by.

How can this by accomplished? thank you very much

3 Answers
--spring.config.location=file:/config/application.properties

could be possibly put to JAVA_OPTS environment variable you specify in file where you start the docker image.

Related