-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
38 lines (34 loc) · 944 Bytes
/
compose.yaml
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
volumes:
mongodb-1-data:
networks:
heimdall-compose-network:
services:
generate-password:
image: busybox:stable
volumes:
- ./db/mongo/secrets/:/usr/local/src
command: sh /usr/local/src/generate-password.sh "/usr/local/src/db_root_password.txt"
mongodb-1:
container_name: mongodb-1
depends_on:
- generate-password
image: mongo:8.0.3
restart: always
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME_FILE: /run/secrets/mongodb-root-username
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongodb-root-password
command: [--auth]
volumes:
- mongodb-1-data:/data/db
secrets:
- mongodb-root-username
- mongodb-root-password
networks:
- heimdall-compose-network
secrets:
mongodb-root-username:
file: ./db/mongo/secrets/db_root_username.txt
mongodb-root-password:
file: ./db/mongo/secrets/db_root_password.txt