Use an external Mongo database with Docker Compose

This commit is contained in:
Paul-Emmanuel Raoul 2018-11-29 15:11:41 +00:00
parent 8beada58d5
commit 290ee213fd
1 changed files with 2 additions and 3 deletions

View File

@ -7,8 +7,7 @@ services:
volumes: volumes:
- db_data:/data/db - db_data:/data/db
environment: environment:
MONGO_INITDB_ROOT_USERNAME: root MONGO_INITDB_DATABASE: monkey
MONGO_INITDB_ROOT_PASSWORD: test
monkey: monkey:
depends_on: depends_on:
- db - db
@ -17,7 +16,7 @@ services:
ports: ports:
- "5000:5000" - "5000:5000"
environment: environment:
MONGO_URL: mongodb://root:test@db:27017/ MONGO_URL: mongodb://db:27017/monkey
volumes: volumes:
db_data: db_data: