forked from I-TECH-UW/ci-hie-demo
-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
462 lines (430 loc) · 14.5 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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
version: '3.8'
networks:
hie:
driver: bridge
services:
###
# Traefik Reverse Proxy
###
traefik:
image: traefik:v2.8.3
restart: unless-stopped
container_name: traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./configs/traefik/traefik.yml:/etc/traefik/traefik.yml
- ./configs/traefik/certs.yml:/etc/traefik/dynamic_conf/certs.yml
# - ./configs/traefik/certs:/etc/certs
- certs:/etc/certs
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=sigdep3_hie'
- 'traefik.http.routers.api.rule=Host(`${HOST_URL}`) && PathPrefix(`/api`) || PathPrefix(`/dashboard`)'
- 'traefik.http.routers.api.service=api@internal'
- 'traefik.http.routers.api.tls=true'
- 'traefik.http.routers.api.entrypoints=web-secure'
networks:
- hie
ports:
- 80:80
- 8080:8080
- 443:443
certbot:
image: certbot/certbot:latest
container_name: certbot
entrypoint: "certbot certonly --standalone -n --agree-tos --email [email protected] -d dev.cihis.org"
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
volumes:
- certs:/etc/letsencrypt
- letsencrypt:/var/lib/letsencrypt
# ports:
# - 80:80
# - 443:443
sigdep3:
image: partnersinhealth/openmrs-server:latest
restart: unless-stopped
depends_on:
sigdep-db:
condition: service_healthy
container_name: sigdep3
hostname: sigdep3
environment:
OMRS_CONFIG_CONNECTION_SERVER: "sigdep-db"
OMRS_CONFIG_CONNECTION_ROOT_PASSWORD: "root"
OMRS_CONFIG_CONNECTION_USERNAME: "root"
OMRS_CONFIG_CONNECTION_PASSWORD: "root"
OMRS_CONFIG_CONNECTION_EXTRA_ARGS: "&autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8&useSSL=false&requireSSL=false"
OMRS_CONFIG_AUTO_UPDATE_DATABASE: "false"
OMRS_CONFIG_CREATE_TABLES: "false"
OMRS_CONFIG_HAS_CURRENT_OPENMRS_DATABASE: "true"
OMRS_DEV_DEBUG_PORT: "1044"
volumes:
- ./configs/sigdep3/distribution:/openmrs/distribution
- .data/sigdep3:/openmrs/data
ports:
- "8090:8080"
- "1044:1044"
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=sigdep3_hie'
- 'traefik.http.services.sigdep3.loadbalancer.server.port=8080'
- 'traefik.http.services.sigdep3.loadbalancer.server.scheme=http'
- 'traefik.http.routers.sigdep3.service=sigdep3'
- 'traefik.http.routers.sigdep3.tls=true'
- 'traefik.http.routers.sigdep3.entrypoints=web-secure'
- 'traefik.http.routers.sigdep3.rule=Host(`${HOST_URL}`) && PathPrefix(`/openmrs`)'
networks:
- hie
sigdep-db:
image: library/mysql:5.6
restart: unless-stopped
hostname: sigdep-db
container_name: sigdep-db
command: "mysqld \
--character-set-server=utf8 \
--collation-server=utf8_general_ci \
--max_allowed_packet=1G \
--default-authentication-plugin=mysql_native_password \
--sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
environment:
MYSQL_DATABASE: "openmrs"
MYSQL_ROOT_PASSWORD: "root"
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 20s
retries: 10
volumes:
- ./configs/sigdep3/init-db:/docker-entrypoint-initdb.d
- .db/sigdep3:/var/lib/mysql
ports:
- "3306:3306"
networks:
- hie
###
# OpenHIM
###
openhim-core:
container_name: openhim-core
hostname: openhim-core
image: jembi/openhim-core:v7.1.0
restart: unless-stopped
environment:
mongo_url: "mongodb://mongo-db/openhim"
mongo_atnaUrl: "mongodb://mongo-db/openhim"
NODE_ENV: "development"
healthcheck:
test: "node /healthcheck.js"
interval: 20s
timeout: 20s
retries: 2
networks:
- hie
volumes:
- ./configs/openhim/healthcheck.js:/healthcheck.js
ports:
- '5001:5001'
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=sigdep3_hie'
- 'traefik.http.services.openhim-api.loadbalancer.server.port=8080'
- 'traefik.http.services.openhim-api.loadbalancer.server.scheme=https'
- 'traefik.http.routers.openhim-api.service=openhim-api'
- 'traefik.http.routers.openhim-api.tls=true'
- 'traefik.http.routers.openhim-api.entrypoints=web-secure'
- 'traefik.http.routers.openhim-api.rule=Host(`${HOST_URL}`) && PathPrefix(`/openhim-api`)'
- 'traefik.http.routers.openhim-api.middlewares=openhim-api'
- 'traefik.http.middlewares.openhim-api.stripprefix.prefixes=/openhim-api'
- 'traefik.http.middlewares.openhim-api.stripprefix.forceSlash=false'
- 'traefik.http.services.openhim-http.loadbalancer.server.port=5001'
- 'traefik.http.services.openhim-http.loadbalancer.server.scheme=http'
- 'traefik.http.routers.openhim-http.service=openhim-http'
- 'traefik.http.routers.openhim-http.tls=false'
- 'traefik.http.routers.openhim-http.entrypoints=web'
- 'traefik.http.routers.openhim-http.rule=Host(`${HOST_URL}`) && PathPrefix(`/openhim-http`)'
- 'traefik.http.routers.openhim-http.middlewares=openhim-http'
- 'traefik.http.middlewares.openhim-http.stripprefix.prefixes=/openhim-http'
- 'traefik.http.middlewares.openhim-http.stripprefix.forceSlash=false'
- 'traefik.http.services.openhim-ssl.loadbalancer.server.port=5000'
- 'traefik.http.services.openhim-ssl.loadbalancer.server.scheme=https'
- 'traefik.http.routers.openhim-ssl.service=openhim-ssl'
- 'traefik.http.routers.openhim-ssl.tls=true'
- 'traefik.http.routers.openhim-ssl.entrypoints=web-secure'
- 'traefik.http.routers.openhim-ssl.rule=Host(`${HOST_URL}`) && PathPrefix(`/openhim-ssl`)'
- 'traefik.http.routers.openhim-ssl.middlewares=openhim-ssl'
- 'traefik.http.middlewares.openhim-ssl.stripprefix.prefixes=/openhim-ssl'
- 'traefik.http.middlewares.openhim-ssl.stripprefix.forceSlash=false'
openhim-console:
container_name: openhim-console
hostname: openhim-console
image: jembi/openhim-console:v1.15.0
restart: unless-stopped
volumes:
- ./configs/openhim-console/default.json:/usr/share/nginx/html/config/default.json
healthcheck:
test: "curl -sS http://openhim-console || exit 1"
interval: 10s
timeout: 60s
retries: 3
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=sigdep3_hie'
- 'traefik.http.routers.openhim-console.tls=true'
- 'traefik.http.routers.openhim-console.entrypoints=web-secure'
- 'traefik.http.routers.openhim-console.rule=Host(`${HOST_URL}`) && PathPrefix(`/openhim`)'
- 'traefik.http.routers.openhim-console.middlewares=openhim-console'
- 'traefik.http.middlewares.openhim-console.stripprefix.prefixes=/openhim'
- 'traefik.http.middlewares.openhim-console.stripprefix.forceSlash=false'
networks:
- hie
# Loads Default OpenHIM Config
openhim-config:
container_name: openhim-config
image: ghcr.io/i-tech-uw/openhim-config:v0.0.0
volumes:
- ./configs/openhim/test-openhim-config.json:/app/test-openhim-config.json
networks:
- hie
mongo-db:
container_name: mongo-db
image: mongo:3.4
volumes:
- .db/openhim:/data/db
restart: unless-stopped
networks:
- hie
###
# OpenCR - Client Registry
###
opencr:
container_name: opencr
hostname: opencr
image: intrahealth/opencr:bac5a14
restart: unless-stopped
environment:
- NODE_ENV=docker
- HAPI_FHIR_URL=http://opencr-fhir:8080/fhir/metadata
networks:
- hie
volumes:
- ./configs/opencr/config.json:/src/server/config/config_docker.json
- ./configs/opencr/mediator.json:/src/server/config/mediator.json
- ./configs/opencr/decisionRules.json:/src/server/config/decisionRules.json
- ./configs/opencr/PatientRelationship.json:/src/resources/Relationships/PatientRelationship.json
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=sigdep3_hie'
- 'traefik.http.routers.opencr.tls=true'
- 'traefik.http.routers.opencr.entrypoints=web-secure'
- 'traefik.http.services.opencr.loadbalancer.server.port=3000'
- 'traefik.http.routers.opencr.rule=Host(`${HOST_URL}`)'
ports:
- 3000:3000
opencr-fhir:
image: hapiproject/hapi:v5.1.0
container_name: opencr-fhir
hostname: opencr-fhir
restart: unless-stopped
networks:
- hie
healthcheck:
test: "curl -sS http://opencr-fhir:8080/fhir/metadata || exit 1"
interval: 90s
timeout: 30s
retries: 3
volumes:
- /data/hapi
# - ./configs/opencr/application.yml:/data/hapi/application.yaml
ports:
- 8081:8080
# env_file:
# - ./configs/opencr/.env
# environment:
# SPRING_CONFIG_LOCATION: 'file:///data/hapi/application.yaml'
es:
container_name: es
hostname: es
image: intrahealth/elasticsearch:latest
restart: unless-stopped
environment:
- node.name=es01
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- /usr/share/elasticsearch/data
networks:
- hie
healthcheck:
test: "curl --silent --fail http://es:9200/_cluster/health || exit 1"
# Kafka Task Runners
zookeeper:
image: 'bitnami/zookeeper:latest'
hostname: zookeeper
restart: unless-stopped
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
volumes:
- /data
networks:
- hie
kafka:
image: 'bitnami/kafka:latest'
hostname: kafka
restart: unless-stopped
container_name: kafka
environment:
- KAFKA_BROKER_ID=1
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
volumes:
- /bitnami/kafka
depends_on:
- zookeeper
entrypoint: sh -c 'sleep 30 && /opt/bitnami/scripts/kafka/entrypoint.sh /opt/bitnami/scripts/kafka/run.sh' # prevent zookeeper conflict error
networks:
- hie
###
# Utility for waiting for Sigdep3 Bootup
###
wait-for-openmrs:
profiles: ['utility']
container_name: wait-for-openmrs
image: ghcr.io/i-tech-uw/wait-for-openmrs-action:latest
command:
- "http://sigdep3:8080/openmrs"
- "20"
- "10000"
networks:
- hie
# Streaming Pipeline
streaming-pipeline:
image: openmrsinfra/openmrs-fhir-analytics:plir-binlog
container_name: streaming-pipeline
networks:
- hie
healthcheck:
test: "exit 0"
volumes:
- ./configs/streaming-pipeline/config.json:/deployments/config.json
# data is the directory which you want to persist the generated parquet files
# - ./configs/streaming-pipeline/parquet:/tmp
environment:
- OPENMRS_URL=http://sigdep3:8080/openmrs
- OPENMRS_USERNAME=admin
- OPENMRS_PASSWORD=Dppeis@pnls_16
- SINK_URL=http://openhim-core:5001/fhir/
- SINK_USERNAME=dbezium
- SINK_PASSWORD=dbezium
- JDBC_FETCH_SIZE=10000
- JDBC_MAX_POOL_SIZE=50
- JDBC_INITIAL_POOL_SIZE=10
- JDBC_DRIVER_CLASS=com.mysql.cj.jdbc.Driver
- JDBC_URL=jdbc:mysql://sigdep-db:3306/openmrs
# the 2 variable below should be same as volume mappings above
#- PARQUET_PATH=
- FHIR_DEBEZIUM_CONFIG_PATH=/deployments/config.json
###
# Testing
###
newman:
image: postman/newman
container_name: newman
profiles: [test]
volumes:
- ./.postman:/.postman
entrypoint: newman run $POSTMAN_COLLECTION -e /.postman/ci.postman_environment.json --insecure --timeout-request 20000 --delay-request 500
networks:
- hie
# OpenELIS Setup
####
# OpenELIS
####
certs:
container_name: oe-certs
image: ghcr.io/i-tech-uw/certgen:main
restart: always
environment:
- KEYSTORE_PW="kspass"
- TRUSTSTORE_PW="tspass"
volumes:
- cert-volume:/etc/openelis-global
- keys-vol:/etc/ssl/private/
- certs-vol:/etc/ssl/certs/
database:
container_name: openelisglobal-database
image: postgres:9.5
ports:
- "15432:5432"
restart: always
env_file:
- ./configs/openelis/database/database.env
volumes:
# preserves the database between containers
- db-data:/var/lib/postgresql/data
# files here will run on install
- ./configs/openelis/database/dbInit:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "clinlims", "-U", "clinlims"]
timeout: 45s
interval: 10s
retries: 10
oe.openelis.org:
container_name: openelisglobal-webapp
image: ghcr.io/i-tech-uw/openelis-global-2:2.7.1.1
depends_on:
- database
ports:
- "8443:8443"
restart: always
environment:
- TZ=Africa/Nairobi
# context.xml doesn't seem to be able to pick up environment variables directly, so we are passing them in as CATALINA_OPTS
- CATALINA_OPTS= -Ddatasource.url=jdbc:postgresql://database:5432/clinlims -Ddatasource.username=clinlims -Ddatasource.password=clinlims
volumes:
- cert-volume:/etc/openelis-global
# - openelis-plugins-data:/var/lib/openelis-global/plugins
- ./configs/openelis/tomcat/oe_server.xml:/usr/local/tomcat/conf/server.xml
secrets:
- source: datasource.password
- source: common.properties
fhir.openelis.org:
container_name: external-fhir-api
image: hapiproject/hapi:v5.5.1
# ports:
# - "8081:8080"
restart: always
environment:
- hapi.fhir.auto_create_placeholder_reference_targets=true
- hapi.fhir.allow_placeholder_references=true
- hapi.fhir.allow_external_references=true
shr-hapi-fhir:
container_name: shr-hapi-fhir
image: hapiproject/hapi:v5.5.1
# ports:
# - "8081:8080"
restart: always
environment:
- hapi.fhir.auto_create_placeholder_reference_targets=true
- hapi.fhir.allow_placeholder_references=true
- hapi.fhir.allow_external_references=true
secrets:
datasource.password:
file: ./configs/openelis/properties/datasource.password
common.properties:
file: ./configs/openelis/properties/common.properties
volumes:
certs: ~
letsencrypt: ~
db-data:
cert-volume:
certs-vol:
keys-vol: