forked from kobotoolbox/kobo-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.local.yml
194 lines (186 loc) · 6.75 KB
/
docker-compose.local.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
# vim: set ts=2 sts=2 sw=2:
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: on-failure
postgres:
image: qeddockerhub/kt-postgres:latest
# Dev: Build the image locally.
# build: ./base_images/postgres
hostname: postgres
env_file:
- ./envfile.local.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: on-failure
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.local.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: on-failure
kobocat:
image: qeddockerhub/kobocat-auto:latest
# Dev: Build the image locally.
# build: ../kobocat
hostname: kobocat
env_file:
- ./envfile.local.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 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
environment:
- ENKETO_PROTOCOL=http
restart: on-failure
kpi:
image: qeddockerhub/kpi-auto:latest
# Dev: Build the image locally.
# build: ../kpi
hostname: kpi
env_file:
- ./envfile.local.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
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: on-failure
nginx:
image: qeddockerhub/kt-nginx:latest
# Dev: Build the image locally.
# build: ./base_images/nginx
hostname: nginx
env_file:
- ./envfile.local.txt
- ./envfiles/nginx.txt
- ./envfiles/kobocat.txt
- ./envfiles/kpi.txt
environment:
- NGINX_CONFIG_FILE_NAME=nginx_site_http.conf
ports:
# NOTE: The host ports (left of the ":") must match the values in
# `envfile.local.txt` and `envfiles/kpi.txt. Do not modify the
# container ports (right side).
- 8000:9000 # KPI
- 8001:9001 # KoBoCAT
- 8005:9005 # Enketo Express
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
links:
- kobocat
- kpi
- enketo_express
restart: on-failure
# 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.local.txt
- ./envfiles/external_services.txt
links:
- redis_main
- redis_cache
restart: on-failure
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
# 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: on-failure
# 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: on-failure