-
-
Notifications
You must be signed in to change notification settings - Fork 257
/
docker-compose.yml
60 lines (59 loc) · 1.63 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: "3.1"
services:
shieldy:
build: .
restart: always
environment:
MONGO_SHIELDY_DB: shieldyDB
MONGO_SHIELDY_USERNAME: shieldyDBuser
MONGO_SHIELDY_PASSWORD_FILE: /run/secrets/mongo_shieldy_password
MONGO_INITDB_DATABASE: shieldyDB
TOKEN_FILE: /run/secrets/shieldy_token
ADMIN: 658158536
secrets:
- shieldy_token
- mongo_shieldy_password
depends_on:
- wait-dependencies
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: mongoadmin
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo_admin_password
MONGO_SHIELDY_USERNAME: shieldyDBuser
MONGO_SHIELDY_PASSWORD_FILE: /run/secrets/mongo_shieldy_password
MONGO_INITDB_DATABASE: shieldyDB
secrets:
- mongo_admin_password
- mongo_shieldy_password
volumes:
- dbdata:/data/db
- ./init-mongo.sh:/docker-entrypoint-initdb.d/init-mongo.sh:ro
wait-dependencies:
image: willwill/wait-for-it:latest
depends_on:
- mongo
entrypoint: /bin/sh
command: >
-c "./wait-for-it.sh mongo:27017 --strict --timeout=1"
# If database debugging is needed
# mongo-express:
# image: mongo-express
# restart: always
# ports:
# - 8081:8081
# environment:
# ME_CONFIG_MONGODB_ADMINUSERNAME: mongoadmin
# ME_CONFIG_MONGODB_ADMINPASSWORD: example
# depends_on:
# - mongo
secrets:
mongo_admin_password:
file: .secrets/mongo_admin_password.txt
mongo_shieldy_password:
file: .secrets/mongo_shieldy_password.txt
shieldy_token:
file: .secrets/shieldy_token.txt
volumes:
dbdata: