-
Notifications
You must be signed in to change notification settings - Fork 1
/
mongodb.yml
62 lines (62 loc) · 1.4 KB
/
mongodb.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
61
62
version: '3.7'
services:
mongo1:
image: mongo:7.0
environment:
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo_admin_password
MONGO_INITDB_ROOT_USERNAME_FILE: /run/secrets/mongo_admin_user
ports:
- 27017:27017
volumes:
- db1:/data/db
secrets:
- mongo_admin_user
- mongo_admin_password
deploy:
placement:
constraints:
- node.hostname == badwcai-ebl01
mongo2:
image: mongo:7.0
environment:
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo_admin_password
MONGO_INITDB_ROOT_USERNAME_FILE: /run/secrets/mongo_admin_user
ports:
- 27018:27017
volumes:
- db2:/data/db
secrets:
- mongo_admin_user
- mongo_admin_password
deploy:
placement:
constraints:
- node.hostname == badwcai-ebl02
mongo3:
image: mongo:7.0
environment:
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo_admin_password
MONGO_INITDB_ROOT_USERNAME_FILE: /run/secrets/mongo_admin_user
ports:
- 27019:27017
volumes:
- db3:/data/db
secrets:
- mongo_admin_user
- mongo_admin_password
deploy:
placement:
constraints:
- node.hostname == badwcai-ebl03
volumes:
db1:
driver: local
db2:
driver: local
db3:
driver: local
secrets:
mongo_admin_user:
external: true
mongo_admin_password:
external: true