DEV Community

Cover image for The mongo docker volume
Visakh Vijayan
Visakh Vijayan

Posted on

The mongo docker volume

I wanted to load the production with fixture data from my local database. One of the possible solutions was copying to the volume from the local database and then restoring it in the production one.

Alt Text

The line under volumes copies the files in the dbdump to the docker-entrypoint-initdb.d

docker-entrypoint-initdb.d is a default folder created under the mongo volumes.

Then in the production one, you can communicate with a container using the exec -it command as mentioned here and do a mongorestore

Hope this helps!

Top comments (0)