Skip to content

Instantly share code, notes, and snippets.

@pedroricardo
Created December 5, 2020 01:58
Show Gist options
  • Save pedroricardo/5fa6a1119be79de3ea8741bdedc30503 to your computer and use it in GitHub Desktop.
Save pedroricardo/5fa6a1119be79de3ea8741bdedc30503 to your computer and use it in GitHub Desktop.
Iniciando um Banco de dados MongoDB em um container Docker
version: '3'
services:
mongodb_container:
image: mongo:latest
container_name: 'MeuDB'
restart: always # iniciar com o servidor
environment:
#MONGO_INITDB_DATABASE: namebanco
MONGO_INITDB_ROOT_USERNAME: usuario
MONGO_INITDB_ROOT_PASSWORD: senha
ports:
- 27017:27017
volumes:
- /home/data/db:/data/db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment