Skip to content

Instantly share code, notes, and snippets.

@LuanComputacao
Created August 8, 2020 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save LuanComputacao/8275dcae5c6fcc5be02b0d7a08378194 to your computer and use it in GitHub Desktop.
Save LuanComputacao/8275dcae5c6fcc5be02b0d7a08378194 to your computer and use it in GitHub Desktop.
Docker compose para MongoDB com armazenamento local
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'
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