Last active
March 9, 2020 16:59
-
-
Save oxlb/1d0e0d4c56c7993bd269099f7e568d11 to your computer and use it in GitHub Desktop.
Docker-Compose MongoDB Multiple Database Example
This file contains hidden or 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
version: '3.7' | |
services: | |
mongo: | |
container_name: container-mongodb | |
image: mongo:latest | |
restart: always | |
ports: | |
- 27017:27017 | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: password | |
MONGO_INITDB_DATABASE: root-db | |
volumes: | |
- ./docker-entrypoint-initdb.d/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment