ship icon indicating copy to clipboard operation
ship copied to clipboard

Add volumes for mongo to have a persistent DB

Open alldayalone opened this issue 4 years ago • 5 comments

alldayalone avatar Apr 30 '20 08:04 alldayalone

@Oigen43 why did you close this 😿

alldayalone avatar Jan 05 '22 13:01 alldayalone

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

Oigen43 avatar Jan 05 '22 14:01 Oigen43

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 avatar Jan 06 '22 07:01 alldayalone

@AllDayAlone Makes sense, I will add this in the future. Thanx 🤝

Oigen43 avatar Jan 06 '22 08:01 Oigen43

Reopen mb to keep track of? @Oigen43

alldayalone avatar Jan 06 '22 08:01 alldayalone

There are noticeable performance issues on macOS. Ordinary volumes are better than these bind mounts.

fruneen avatar Mar 05 '24 14:03 fruneen