As documented on the docker hub page for that image (https://hub.docker.com/_/mongo/) you can use
volumes:
- './data:/data/db'
Which will use the host path ./data
As documented on the docker hub page for that image (https://hub.docker.com/_/mongo/) you can use
volumes:
- './data:/data/db'
Which will use the host path ./data