This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.replicas-5.yml
209 lines (197 loc) · 6.95 KB
/
docker-compose.replicas-5.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# OpenCRVS is also distributed under the terms of the Civil Registration
# & Healthcare Disclaimer located at http://opencrvs.org/license.
#
# Copyright (C) The OpenCRVS Authors. OpenCRVS and the OpenCRVS
# graphic logo are (registered/a) trademark(s) of Plan International.
version: '3.3'
services:
user-mgnt:
environment:
- MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/user-mgnt?replicaSet=rs0
webhooks:
environment:
- MONGO_URL=mongodb://webhooks:${WEBHOOKS_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/webhooks?replicaSet=rs0
config:
environment:
- MONGO_URL=mongodb://config:${CONFIG_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/application-config?replicaSet=rs0
hearth:
environment:
- mongodb__url=mongodb://hearth:${HEARTH_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/hearth-dev?replicaSet=rs0
depends_on:
- mongo1
- mongo2
- mongo3
migration:
environment:
- HEARTH_MONGO_URL=mongodb://hearth:${HEARTH_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/hearth-dev?replicaSet=rs0
- OPENHIM_MONGO_URL=mongodb://openhim:${OPENHIM_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/openhim-dev?replicaSet=rs0
- WAIT_HOSTS=mongo1:27017,mongo2:27017,mongo3:27017,mongo4:27017,mongo5:27017,influxdb:8086
depends_on:
- mongo1
- mongo2
- mongo3
openhim-core:
environment:
- mongo_url=mongodb://openhim:${OPENHIM_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/openhim-dev?replicaSet=rs0
- mongo_atnaUrl=mongodb://openhim:${OPENHIM_MONGODB_PASSWORD}@mongo1,mongo2,mongo3,mongo4,mongo5/openhim-dev?replicaSet=rs0
depends_on:
- mongo1
- mongo2
- mongo3
mongo2:
image: mongo:4.4
hostname: 'mongo2'
container_name: 'mongo2'
restart: unless-stopped
command: mongod --auth --replSet rs0 --keyFile /etc/mongodb-keyfile
volumes:
- '/data/mongo:/data/db'
- '/mongodb-keyfile:/mongodb-keyfile'
# https://github.com/docker-library/mongo/issues/475
entrypoint:
- bash
- -c
- |
cp /mongodb-keyfile /etc/mongodb-keyfile
chmod 400 /etc/mongodb-keyfile
chown 999:999 /etc/mongodb-keyfile
exec docker-entrypoint.sh $$@
configs:
- source: mongo-init.{{ts}}
target: /docker-entrypoint-initdb.d/create-mongo-users.sh
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_ADMIN_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ADMIN_PASSWORD}
- USER_MGNT_MONGODB_PASSWORD=${USER_MGNT_MONGODB_PASSWORD}
- HEARTH_MONGODB_PASSWORD=${HEARTH_MONGODB_PASSWORD}
- CONFIG_MONGODB_PASSWORD=${CONFIG_MONGODB_PASSWORD}
- OPENHIM_MONGODB_PASSWORD=${OPENHIM_MONGODB_PASSWORD}
- WEBHOOKS_MONGODB_PASSWORD=${WEBHOOKS_MONGODB_PASSWORD}
deploy:
replicas: 1
placement:
constraints:
- node.labels.data2 == true
networks:
- overlay_net
mongo3:
image: mongo:4.4
hostname: 'mongo3'
container_name: 'mongo3'
restart: unless-stopped
command: mongod --auth --replSet rs0 --keyFile /etc/mongodb-keyfile
volumes:
- '/data/mongo:/data/db'
- '/mongodb-keyfile:/mongodb-keyfile'
# https://github.com/docker-library/mongo/issues/475
entrypoint:
- bash
- -c
- |
cp /mongodb-keyfile /etc/mongodb-keyfile
chmod 400 /etc/mongodb-keyfile
chown 999:999 /etc/mongodb-keyfile
exec docker-entrypoint.sh $$@
configs:
- source: mongo-init.{{ts}}
target: /docker-entrypoint-initdb.d/create-mongo-users.sh
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_ADMIN_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ADMIN_PASSWORD}
- USER_MGNT_MONGODB_PASSWORD=${USER_MGNT_MONGODB_PASSWORD}
- HEARTH_MONGODB_PASSWORD=${HEARTH_MONGODB_PASSWORD}
- CONFIG_MONGODB_PASSWORD=${CONFIG_MONGODB_PASSWORD}
- OPENHIM_MONGODB_PASSWORD=${OPENHIM_MONGODB_PASSWORD}
- WEBHOOKS_MONGODB_PASSWORD=${WEBHOOKS_MONGODB_PASSWORD}
deploy:
replicas: 1
placement:
constraints:
- node.labels.data3 == true
networks:
- overlay_net
mongo4:
image: mongo:4.4
hostname: 'mongo4'
container_name: 'mongo4'
restart: unless-stopped
command: mongod --auth --replSet rs0 --keyFile /etc/mongodb-keyfile
volumes:
- '/data/mongo:/data/db'
- '/mongodb-keyfile:/mongodb-keyfile'
# https://github.com/docker-library/mongo/issues/475
entrypoint:
- bash
- -c
- |
cp /mongodb-keyfile /etc/mongodb-keyfile
chmod 400 /etc/mongodb-keyfile
chown 999:999 /etc/mongodb-keyfile
exec docker-entrypoint.sh $$@
configs:
- source: mongo-init.{{ts}}
target: /docker-entrypoint-initdb.d/create-mongo-users.sh
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_ADMIN_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ADMIN_PASSWORD}
- USER_MGNT_MONGODB_PASSWORD=${USER_MGNT_MONGODB_PASSWORD}
- HEARTH_MONGODB_PASSWORD=${HEARTH_MONGODB_PASSWORD}
- CONFIG_MONGODB_PASSWORD=${CONFIG_MONGODB_PASSWORD}
- OPENHIM_MONGODB_PASSWORD=${OPENHIM_MONGODB_PASSWORD}
- WEBHOOKS_MONGODB_PASSWORD=${WEBHOOKS_MONGODB_PASSWORD}
deploy:
replicas: 1
placement:
constraints:
- node.labels.data3 == true
networks:
- overlay_net
mongo5:
image: mongo:4.4
hostname: 'mongo5'
container_name: 'mongo5'
restart: unless-stopped
command: mongod --auth --replSet rs0 --keyFile /etc/mongodb-keyfile
volumes:
- '/data/mongo:/data/db'
- '/mongodb-keyfile:/mongodb-keyfile'
# https://github.com/docker-library/mongo/issues/475
entrypoint:
- bash
- -c
- |
cp /mongodb-keyfile /etc/mongodb-keyfile
chmod 400 /etc/mongodb-keyfile
chown 999:999 /etc/mongodb-keyfile
exec docker-entrypoint.sh $$@
configs:
- source: mongo-init.{{ts}}
target: /docker-entrypoint-initdb.d/create-mongo-users.sh
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_ADMIN_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ADMIN_PASSWORD}
- USER_MGNT_MONGODB_PASSWORD=${USER_MGNT_MONGODB_PASSWORD}
- HEARTH_MONGODB_PASSWORD=${HEARTH_MONGODB_PASSWORD}
- CONFIG_MONGODB_PASSWORD=${CONFIG_MONGODB_PASSWORD}
- OPENHIM_MONGODB_PASSWORD=${OPENHIM_MONGODB_PASSWORD}
- WEBHOOKS_MONGODB_PASSWORD=${WEBHOOKS_MONGODB_PASSWORD}
deploy:
replicas: 1
placement:
constraints:
- node.labels.data3 == true
networks:
- overlay_net
mongo-on-update:
depends_on:
- mongo1
- mongo2
- mongo3
- mongo4
- mongo5
environment:
- REPLICAS=5