-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
43 lines (39 loc) · 903 Bytes
/
docker-compose.yml
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
33
34
35
36
37
38
39
40
41
42
43
# Services
services:
# MongoDb
mongodb:
image: mongo:4.4.17-focal
container_name: mongodb
restart: always
env_file: ./.env
ports:
- "${MONGODB_PORT}:${MONGODB_PORT}"
volumes:
- db:/data/db
- ./init.js:/docker-entrypoint-initdb.d/init.js:ro
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_PASSWORD}
networks:
- my-network
# Mongo Express
mongo-express:
image: mongo-express:0.54.0
container_name: mongo-express
restart: always
env_file: ./.env
ports:
- 5000:8081
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGODB_USER}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGODB_PASSWORD}
- ME_CONFIG_MONGODB_SERVER=mongodb
networks:
- my-network
# Volumes
volumes:
db:
# Networks
networks:
my-network:
driver: bridge