Created
August 14, 2023 06:17
-
-
Save BrianMwas/5ca5a386d199baaeefb294a3250fbeef to your computer and use it in GitHub Desktop.
Complete Docker compose configuration for MongoDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongo: | |
image: mongo | |
restart: always | |
container_name: mongo | |
ports: | |
- "8081:27017" | |
volumes: | |
- ./data/mongo:/data/db | |
# We have added it here. Ensure its under the /docker-entrypoint-initdb.d | |
- ./data/mongo/init.js:/docker-entrypoint-initdb.d/init.js:ro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment