I have a spring boot application that connects to a mongo db and deployed the app with docker. I am using this docker-compose.yml file, which works fine:
version: '2'
services:
db:
container_name: app-db
image: mongo
volumes:
- /data/db:/data/db
ports:
- 27017:27017
web:
container_name: spring-app
image: spring-app
depends_on:
- db
environment:
SPRING_DATA_MONGODB_URI: mongodb://db:27017/appDB
SPRING_DATA_MONGODB_HOST: db
ports:
- 8080:8080
Currently, the app is using the application.properties file embedded in the spring app docker image (spring-app). How do I externalize / pass-in the application.properties file using docker-compose?
Thank you for your help