forked from kobotoolbox/kobo-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.server.yml
215 lines (206 loc) · 7.85 KB
/
docker-compose.server.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
# vim: set ts=2 sts=2 sw=2:
# For public, HTTPS servers.
rabbit:
image: qeddockerhub/kt-rabbit:latest
# Dev: Build the image locally.
# build: ./base_images/rabbit
hostname: rabbit
environment:
- RABBITMQ_LOG_BASE=/var/log/rabbitmq
volumes:
- ./log/rabbitmq:/var/log/rabbitmq
restart: unless-stopped
postgres:
image: qeddockerhub/kt-postgres:latest
# Dev: Build the image locally.
# build: ./base_images/postgres
hostname: postgres
env_file:
- ./envfile.server.txt
volumes:
- ./.vols/db:/srv/db
- ./backups/postgres:/srv/backups
- ./base_images/postgres/init_postgres.bash:/etc/my_init.d/10_init_postgres.bash:ro
restart: unless-stopped
mongo:
image: qeddockerhub/kt-mongo:latest
# Dev: Build the image locally.
# build: ./base_images/mongo
hostname: mongo
environment:
- MONGO_DATA=/srv/db
env_file:
- ./envfile.server.txt
# NOTE: On OS X and Windows, comment out the following `volumes` directive
# as a workaround to a VirtualBox folder sharing+Mongo incompatibility.
# See the "WARNING" at https://hub.docker.com/_/mongo/
volumes:
- ./.vols/mongo:/srv/db
- ./backups/mongo:/srv/backups
restart: unless-stopped
kobocat:
image: qeddockerhub/kobocat-auto:latest
# Dev: Build the image locally.
# build: ../kobocat
hostname: kobocat
env_file:
- ./envfile.server.txt
- ./envfiles/aws.txt
- ./envfiles/external_services.txt
- ./envfiles/kobocat.txt
- ./envfiles/nginx.txt
- ./envfiles/smtp.txt
- ./envfiles/rabbit.txt
- ./envfiles/mongo.txt
- ./envfiles/postgres.txt
- ./envfiles/kpi.txt
links:
- rabbit
- mongo
- postgres
- kpi
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_rabbit.bash:/etc/my_init.d/01_wait_for_rabbit.bash:ro
- ./scripts/wait_for_mongo.bash:/etc/my_init.d/02_wait_for_mongo.bash:ro
- ./scripts/wait_for_postgres.bash:/etc/my_init.d/03_wait_for_postgres.bash:ro
- ./scripts/wait_for_kpi.bash:/etc/my_init.d/04_wait_for_kpi.bash:ro
- ./scripts/runtime_variables_kobocat.source.bash:/etc/profile.d/runtime_variables_kobocat.source.bash.sh:ro
# Dev: Use live source directories from the host machine.
#- ../kobocat:/srv/src/kobocat
#- ../formpack/src/formpack:/usr/local/lib/python2.7/dist-packages/formpack
# Dev: Share PyDev remote debugger into container.
#- ~/devel/liclipse/plugins/org.python.pydev_5.4.0.201611281405/pysrc:/srv/pydev_orig:ro
# Dev: Share your `.transifexrc` into the container.
# - ./.transifexrc:/root/.transifexrc
environment:
- ENKETO_PROTOCOL=https
restart: unless-stopped
# NOTE: Workaround to force name resolution inside containers. If enabled,
# customize with your actual subdomains+domain and server IP. Clients
# might also need similar manipulations to their `hosts` files.
# extra_hosts:
# - 'ee-local.kobotoolbox.org:172.17.0.1'
# - 'kf-local.kobotoolbox.org:172.17.0.1'
kpi:
image: qeddockerhub/kpi-auto:latest
# Dev: Build the image locally.
# build: ../kpi
hostname: kpi
env_file:
- ./envfile.server.txt
- ./envfiles/aws.txt
- ./envfiles/external_services.txt
- ./envfiles/kpi.txt
- ./envfiles/nginx.txt
- ./envfiles/smtp.txt
- ./envfiles/rabbit.txt
- ./envfiles/mongo.txt
- ./envfiles/postgres.txt
environment:
- SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO, https
links:
- postgres
- rabbit
- mongo
volumes:
- ./.vols/static/kpi:/srv/static
# The Whoosh search index needs persistent storage
- ./.vols/whoosh:/srv/whoosh
- ./log/kpi:/srv/logs
- ./scripts/wait_for_rabbit.bash:/etc/my_init.d/01_wait_for_rabbit.bash:ro
- ./scripts/wait_for_mongo.bash:/etc/my_init.d/02_wait_for_mongo.bash:ro
- ./scripts/wait_for_postgres.bash:/etc/my_init.d/03_wait_for_postgres.bash:ro
- ./scripts/create_kobo_superuser.bash:/etc/my_init.d/20_create_kobo_superuser.bash:ro
- ./scripts/runtime_variables_kpi.source.bash:/etc/profile.d/runtime_variables_kpi.source.bash.sh:ro
# Dev: Use live source directories from the host machine.
#- ../kpi:/srv/src/kpi
#- ../formpack/src/formpack:/usr/local/lib/python2.7/dist-packages/formpack
# Allow access to Kobocat's media uploads within KPI
- ./.vols/kobocat_media_uploads:/srv/src/kobocat/media
# Dev: Share PyDev remote debugger source into container.
#- ~/devel/liclipse/plugins/org.python.pydev_5.4.0.201611281405/pysrc:/srv/pydev_orig:ro
# Dev: Share your `.transifexrc` into the container.
# - ./.transifexrc:/root/.transifexrc
restart: unless-stopped
# NOTE: Workaround to force name resolution inside containers. If enabled,
# customize with your actual subdomains+domain and server IP. Clients
# might also need similar manipulations to their `hosts` files.
# extra_hosts:
# - 'ee-local.kobotoolbox.org:172.17.0.1'
# - 'kc-local.kobotoolbox.org:172.17.0.1'
nginx:
image: qeddockerhub/kt-nginx:latest
# Dev: Build the image locally.
# build: ./base_images/nginx
hostname: nginx
env_file:
- ./envfile.server.txt
- ./envfiles/nginx.txt
- ./envfiles/kobocat.txt
- ./envfiles/kpi.txt
environment:
- NGINX_CONFIG_FILE_NAME=nginx_site_https.conf
- TEMPLATED_VAR_REFS=$${PUBLIC_DOMAIN_NAME} $${KOBOFORM_PUBLIC_SUBDOMAIN} $${KOBOCAT_PUBLIC_SUBDOMAIN} $${ENKETO_EXPRESS_PUBLIC_SUBDOMAIN}
- LOAD_BALANCERS_IPS=""
ports:
- 80:80
- 443:443
volumes:
- ./.vols/static:/srv/www:ro
# get the logs out of glusterfs!
- ./log/nginx:/var/log/nginx
- ./nginx/:/tmp/kobo_nginx/:ro
- ./nginx/nginx_command.bash:/etc/service/nginx/run:ro
- ./secrets/:/tmp/kobo_toolbox_secrets/:ro
links:
- kobocat
- kpi
- enketo_express
restart: unless-stopped
# Adapted from https://github.com/kobotoolbox/enketo-express/blob/master/setup/docker/docker-compose.yml
# TODO: consider switching to qeddockerhub/enketo-express-extra-widgets
enketo_express:
image: qeddockerhub/enketo-express:latest
# Dev: Build the image locally.
# build: ../enketo-express/
env_file:
- ./envfile.server.txt
- ./envfiles/external_services.txt
links:
- redis_main
- redis_cache
restart: unless-stopped
volumes:
- ./scripts/runtime_variables_enketo_express.source.bash:/etc/profile.d/runtime_variables_enketo_express.source.bash.sh:ro
- ./enketo_express/config.json:/srv/tmp/enketo_express_config.json:ro
- ./scripts/enketo_express_copy_config.bash:/etc/my_init.d/01_enketo_express_copy_config.bash:ro
# Override Enketo Express icons.
- ./enketo_express/favicon.ico:/srv/src/enketo_express/public/images/favicon.ico:ro
- ./enketo_express/icon_180x180.png:/srv/src/enketo_express/public/images/icon_180x180.png:ro
# Dev: Use the live `enketo-express` directory from the host machine.
# - ../enketo-express:/srv/src/enketo_express
# NOTE: Workaround to force name resolution inside containers. If enabled,
# customize with your actual subdomains+domain and server IP. Clients
# might also need similar manipulations to their `hosts` files.
# extra_hosts:
# - 'kf-local.kobotoolbox.org:172.17.0.1'
# - 'kc-local.kobotoolbox.org:172.17.0.1'
# Adapted from https://github.com/kobotoolbox/enketo-express/blob/master/setup/docker/docker-compose.yml
redis_main:
image: redis:2.6
# Map our "main" Redis config into the container.
volumes:
- ./redis/redis-enketo-main.conf:/etc/redis/redis.conf:ro
- ./.vols/redis_main_data/:/data/
restart: unless-stopped
# Adapted from https://github.com/kobotoolbox/enketo-express/blob/master/setup/docker/docker-compose.yml
redis_cache:
image: redis:2.6
# Map our "cache" Redis config into the container.
volumes:
- ./redis/redis-enketo-cache.conf:/etc/redis/redis.conf:ro
restart: unless-stopped