-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
27 lines (26 loc) · 885 Bytes
/
docker-compose.yml
File metadata and controls
27 lines (26 loc) · 885 Bytes
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
version: '3.8'
services:
mongodb:
image: mongo:latest # use the latest image
container_name: mongodb # container's name
restart: unless-stopped
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME} # set container root username
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD} # set container root password
volumes:
- ./db-data:/data/db
ports:
- '27017-27019:27017-27019'
# Mongo Express Service
mongo-express:
image: mongo-express:latest # latest image
container_name: mongo-express
restart: unless-stopped
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_PASSWORD}
ME_CONFIG_MONGODB_SERVER: mongodb
# use the name of the mongo container above for server env var.
# In our case this is mongodb