Created
April 2, 2020 00:34
-
-
Save BetterProgramming/1abbc0d891fa7d3e2b758b5bbf90188a to your computer and use it in GitHub Desktop.
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
services: | |
db: | |
image: mongo:latest | |
ports: | |
- "27017:27017" | |
container_name: db | |
volumes: shared_database:/data/db | |
vc_db: | |
image: mongo:latest | |
volumes: shared_database:/data/db | |
volumes: | |
shared_database; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was referring to your article here - https://betterprogramming.pub/persistent-databases-using-dockers-volumes-and-mongodb-9ac284c25b39
I tried to create the docker compose the way you have instructed. But when I run it, it creates the instances as defined, but always shuts down my mongodb runtime instance. It still keeps the vc instance running. My application instance is running as well.
Do you think this approach is still valid? Any other ways to handle this?
Thanks, Sushant
Here is my setup: Docker on Windows10 with Linux container
Here is the docker compose: