Mongo on Docker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

# Use root/example as user/password credentials
version: '3.5'

networks:
consumer:
name: consumer

services:
mongo:
container_name: 'mongo'
image: mongo
restart: always
volumes:
- '/tmp/docker/data/mongo:/data/db'
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
networks:
- consumer

mongo-express:
container_name: 'mongo_express'
image: mongo-express
restart: always
ports:
- 8082:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: root
networks:
- consumer

Reference