ship
ship copied to clipboard
Add volumes for mongo to have a persistent DB
@Oigen43 why did you close this 😿
We are no longer deploying MongoDB on a cluster, the best solution would be to use managed MongoDB in Atlas or DigitalOcean.
When developing locally we use Docker volumes, so DB is persistent.
So this issue is not actual
I see. Have a suggestion though. To store mongo volumes inside the workspace and not in external volumes
services:
mongo:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- type: volume
source: mongodb
target: /data/db
- type: volume
source: mongodb-cfg
target: /data/configdb
volumes:
mongodb:
mongodb-cfg:
services:
mongo:
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .dev/mongo/db:/data/db
- .dev/mongo/configdb:/data/configdb
and add .dev
in .gitignore
@AllDayAlone Makes sense, I will add this in the future. Thanx 🤝
Reopen mb to keep track of? @Oigen43
There are noticeable performance issues on macOS. Ordinary volumes are better than these bind mounts.