forked from kobotoolbox/kobo-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.frontend.yml
125 lines (120 loc) · 4.33 KB
/
docker-compose.frontend.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
# NOTE: Generate `../kobo-env/` environment files using
# https://github.com/kobotoolbox/kobo-install. You may manually customize the
# files afterwards and stop using kobo-install if necessary.
version: '3'
services:
kobocat:
image: kobotoolbox/kobocat:2.024.04b
hostname: kobocat
env_file:
- ../kobo-env/envfile.txt
- ../kobo-env/envfiles/databases.txt
- ../kobo-env/envfiles/aws.txt
- ../kobo-env/envfiles/external_services.txt
- ../kobo-env/envfiles/kobocat.txt
- ../kobo-env/envfiles/nginx.txt
- ../kobo-env/envfiles/smtp.txt
sysctls:
- net.core.somaxconn=2048
environment:
- ENKETO_PROTOCOL=https
- KPI_PORT=8000
- KC_UWSGI_MAX_REQUESTS=512
- KC_UWSGI_WORKERS_COUNT=2
- KC_UWSGI_CHEAPER_RSS_LIMIT_SOFT=134217728
- KC_UWSGI_CHEAPER_WORKERS_COUNT=1
- KC_UWSGI_HARAKIRI=120
- KC_UWSGI_WORKER_RELOAD_MERCY=120
volumes:
- ./.vols/static/kobocat:/srv/static
- ./.vols/kobocat_media_uploads:/srv/src/kobocat/media
- ./backups/kobocat:/srv/backups
- ./log/kobocat:/srv/logs
- ./scripts/wait_for_mongo.bash:/srv/init/wait_for_mongo.bash:ro
- ./scripts/wait_for_postgres.bash:/srv/init/wait_for_postgres.bash:ro
- ./scripts/runtime_variables_kobocat.source.bash:/etc/profile.d/runtime_variables_kobocat.source.bash.sh:ro
restart: always
networks:
kobo-fe-network:
aliases:
- kobocat
- kobocat.docker.container
- kobocat.internal
kpi:
image: kobotoolbox/kpi:2.024.04b
hostname: kpi
env_file:
- ../kobo-env/envfile.txt
- ../kobo-env/envfiles/databases.txt
- ../kobo-env/envfiles/aws.txt
- ../kobo-env/envfiles/external_services.txt
- ../kobo-env/envfiles/kpi.txt
- ../kobo-env/envfiles/nginx.txt
- ../kobo-env/envfiles/smtp.txt
sysctls:
- net.core.somaxconn=2048
environment:
- SYNC_KOBOCAT_XFORMS=False # Should be True on at least one frontend environment
- KPI_UWSGI_MAX_REQUESTS=512
- KPI_UWSGI_WORKERS_COUNT=2
- KPI_UWSGI_CHEAPER_RSS_LIMIT_SOFT=134217728
- KPI_UWSGI_CHEAPER_WORKERS_COUNT=1
- KPI_UWSGI_HARAKIRI=120
- KPI_UWSGI_WORKER_RELOAD_MERCY=120
volumes:
- ./.vols/static/kpi:/srv/static
- ./log/kpi:/srv/logs
- ./scripts/wait_for_mongo.bash:/srv/init/wait_for_mongo.bash:ro
- ./scripts/wait_for_postgres.bash:/srv/init/wait_for_postgres.bash:ro
- ./scripts/runtime_variables_kpi.source.bash:/etc/profile.d/runtime_variables_kpi.source.bash.sh:ro
# Persistent storage for FileFields when S3 not used (e.g. exports, uploaded map layers)
- ./.vols/kpi_media:/srv/src/kpi/media
# Allow access to KoBoCAT media uploads within KPI
- ./.vols/kobocat_media_uploads:/srv/src/kobocat/media
restart: always
networks:
kobo-fe-network:
aliases:
- kpi
- kpi.docker.container
- kpi.internal
nginx:
image: nginx:1.21
hostname: nginx
env_file:
- ../kobo-env/envfile.txt
- ../kobo-env/envfiles/databases.txt
- ../kobo-env/envfiles/nginx.txt
- ../kobo-env/envfiles/kobocat.txt
- ../kobo-env/envfiles/kpi.txt
environment:
- UWSGI_PASS_TIMEOUT=130
- TEMPLATED_VAR_REFS=$${PUBLIC_REQUEST_SCHEME} $${INTERNAL_DOMAIN_NAME} $${PUBLIC_DOMAIN_NAME} $${KOBOFORM_PUBLIC_SUBDOMAIN} $${KOBOCAT_PUBLIC_SUBDOMAIN} $${ENKETO_EXPRESS_PUBLIC_SUBDOMAIN}
volumes:
- ./.vols/static:/srv/www:ro
- ./log/nginx:/var/log/nginx
- ./.vols/kobocat_media_uploads:/media
- ./.vols/kpi_media/__public:/srv/kpi_media/__public:ro
- ./nginx/docker-entrypoint.d/30-init-kobo-nginx.sh:/docker-entrypoint.d/30-init-kobo-nginx.sh
- ./nginx/kobo-docker-scripts/:/kobo-docker-scripts
restart: always
networks:
kobo-fe-network:
aliases:
- nginx
- nginx.internal
enketo_express:
image: forsah-registry.dgstg.org/forsah/docker-enketo_express-forsah:1.0
env_file:
- ../kobo-env/envfile.txt
restart: always
volumes:
- ../kobo-env/enketo_express/config.json:/srv/src/enketo_express/config/config.json
networks:
kobo-fe-network:
aliases:
- enketo_express
- enketo_express.internal
networks:
kobo-fe-network:
driver: bridge