Created
August 8, 2020 01:05
-
-
Save LuanComputacao/8275dcae5c6fcc5be02b0d7a08378194 to your computer and use it in GitHub Desktop.
Docker compose para MongoDB com armazenamento local
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
version: '3' | |
services: | |
databse: | |
image: 'mongo' | |
container_name: 'mongo-dota' | |
environment: | |
- MONGO_INITDB_DATABASE=dota | |
- MONGO_INITDB_ROOT_USERNAME=teomewhy | |
- MONGO_INITDB_ROOT_PASSWORD=123 | |
volumes: | |
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro | |
- ./mongo-volume:/data/db | |
ports: | |
- '27017-27019:27017-27019' | |
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
db.createUser({ | |
user: "teomewhy", | |
pwd: "123", | |
roles: [{ | |
role: "readWrite", | |
db: "dota" | |
}] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment