I'm trying to run the a docker-compose
operation which spawns up a Redis
and MongoDb
instance and which (should) provide the MongoDb
instance with a data-file
from the host pc through the volumes
specification.
I can successfully boot up the container using the following docker-compose.yml
:
redis:
image: redis
ports:
- "6379:6379"
mongo:
image: mongo:latest
volumes:
- ./data/db:/data/db
ports:
- "27017:27017"
command: --rest
assuming it should 'mount' the directory data/db
of which the data
dir is next to the docker-compose.exe
file.
I can connect to both Redis
and MongoDb
, but a simple query on a collection performing a count()
returns 0
(which should contain data). Which leads me to believe that the mounting of the volumes
property isn't working.
If I check the file structure on the container I don't see a /data
folder... Am I missing something here... Thanks for any lead!