forked from dhis2/dhis2-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
56 lines (52 loc) · 2.15 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
version: "3.8"
services:
web:
image: "${DHIS2_IMAGE:-dhis2/core-dev:local}"
ports:
- 127.0.0.1:8080:8080 # DHIS2
- 127.0.0.1:8081:8081 # Debugger: connect using commandline flag -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8081
- 127.0.0.1:9010:9010 # JMX port (for example for VisualVM)
volumes:
- ./docker/dhis.conf:/opt/dhis2/dhis.conf:ro
- ./docker/log4j2.xml:/opt/dhis2/log4j2.xml:ro
environment:
JAVA_OPTS: "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8081 \
-Dlog4j2.configurationFile=/opt/dhis2/log4j2.xml
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9010 \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false"
depends_on:
db:
condition: service_healthy
db:
image: ghcr.io/baosystems/postgis:12-3.3
ports:
- 127.0.0.1:5432:5432
volumes:
- db-dump:/docker-entrypoint-initdb.d/
environment:
POSTGRES_USER: dhis
POSTGRES_DB: dhis
POSTGRES_PASSWORD: &postgres_password dhis
PGPASSWORD: *postgres_password # needed by psql in healthcheck
healthcheck:
test: ["CMD-SHELL", "psql --no-password --quiet --username $$POSTGRES_USER postgres://127.0.0.1/$$POSTGRES_DB -p 5432 --command \"SELECT 'ok'\" > /dev/null"]
start_period: 120s
interval: 1s
timeout: 3s
retries: 5
depends_on:
db-dump:
condition: service_completed_successfully # make sure the DB dump has been downloaded
db-dump:
image: busybox # busybox wget version does not have --no-clobber, so we need to do the [ -f ] test
command: sh -c '[ -f dump.sql.gz ] && echo "dump.sql.gz exists" || wget --output-document dump.sql.gz $$DHIS2_DB_DUMP_URL' # only download file if it does not exist
environment:
DHIS2_DB_DUMP_URL: "${DHIS2_DB_DUMP_URL:-https://databases.dhis2.org/sierra-leone/dev/dhis2-db-sierra-leone.sql.gz}"
working_dir: /opt/dump
volumes:
- db-dump:/opt/dump
volumes:
db-dump: