forked from WildMeOrg/houston
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.codex.yml
472 lines (451 loc) · 14.1 KB
/
docker-compose.codex.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
463
464
465
466
467
468
469
470
471
472
version: "3.8"
services:
db:
image: postgres:13.4
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres || exit 1"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
user: postgres
volumes:
- db-pgdata-var:/var/lib/postgresql/data
# DB initialization scripts
- .dockerfiles/db/initdb.d/:/docker-entrypoint-initdb.d/
networks:
- intranet
environment:
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
WBIA_DB_NAME: "${WBIA_DB_NAME}"
WBIA_DB_USER: "${WBIA_DB_USER}"
WBIA_DB_PASSWORD: "${WBIA_DB_PASSWORD}"
WILDBOOK_DB_NAME: "${WILDBOOK_DB_NAME}"
WILDBOOK_DB_USER: "${WILDBOOK_DB_USER}"
WILDBOOK_DB_PASSWORD: "${WILDBOOK_DB_PASSWORD}"
HOUSTON_DB_NAME: "${HOUSTON_DB_NAME}"
HOUSTON_DB_USER: "${HOUSTON_DB_USER}"
HOUSTON_DB_PASSWORD: "${HOUSTON_DB_PASSWORD}"
redis:
image: redis:latest
command: ["redis-server", "/redis.conf"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes:
- redis-var:/data
- .dockerfiles/redis/redis.conf:/redis.conf
networks:
- intranet
elasticsearch:
# https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail 127.0.0.1:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes:
- es-var1:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
networks:
- intranet
ports:
# development exposure, not exposed in production
- 9200:9200
- 9300:9300
environment:
- node.name=elasticsearch
- discovery.seed_hosts=elasticsearch2,elasticsearch3
- cluster.initial_master_nodes=elasticsearch,elasticsearch2,elasticsearch3
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
elasticsearch2:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
depends_on:
- elasticsearch
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail 127.0.0.1:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes:
- es-var2:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
networks:
- intranet
environment:
- node.name=elasticsearch2
- discovery.seed_hosts=elasticsearch,elasticsearch3
- cluster.initial_master_nodes=elasticsearch,elasticsearch2,elasticsearch3
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
elasticsearch3:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
depends_on:
- elasticsearch2
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail 127.0.0.1:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes:
- es-var3:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
networks:
- intranet
environment:
- node.name=elasticsearch3
- discovery.seed_hosts=elasticsearch,elasticsearch2
- cluster.initial_master_nodes=elasticsearch,elasticsearch2,elasticsearch3
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
kibana:
image: docker.elastic.co/kibana/kibana:7.17.0
depends_on:
elasticsearch:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail 127.0.0.1:5601/status || exit 1"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
networks:
- intranet
ports:
- 5601:5601
environment:
ELASTICSEARCH_HOSTS: "http://${ELASTICSEARCH_HOSTS}"
sage:
# https://github.com/WildMeOrg/wildbook-ia
image: wildme/wbia:latest
command: ["--db-uri", "${WBIA_DB_URI}"]
depends_on:
db:
condition: service_healthy
# healthcheck: # WBIA defines it's own health check and is already labeled for autoheal
# labels:
# - autoheal=true
volumes:
- sage-database-var:/data/db
- sage-cache-var:/cache
networks:
- intranet
ports:
# FIXME: exposed for developer verification
- "82:5000"
environment:
WBIA_DB_URI: "${WBIA_DB_URI}"
HOUSTON_CLIENT_ID: "${HOUSTON_CLIENT_ID}"
HOUSTON_CLIENT_SECRET: "${HOUSTON_CLIENT_SECRET}"
sage-sync:
# https://github.com/WildMeOrg/wildbook-ia
image: wildme/wbia:latest
command: ["--db-uri", "${WBIA_DB_URI}"]
depends_on:
sage:
condition: service_healthy
db:
condition: service_healthy
# healthcheck: # WBIA defines it's own health check and is already labeled for autoheal
# labels:
# - autoheal=true
volumes:
- sage-database-var:/data/db
- sage-cache-var:/cache
networks:
- intranet
environment:
WBIA_DB_URI: "${WBIA_DB_URI}"
HOUSTON_CLIENT_ID: "${HOUSTON_CLIENT_ID}"
HOUSTON_CLIENT_SECRET: "${HOUSTON_CLIENT_SECRET}"
#edm:
# # See: https://github.com/WildMeOrg/Wildbook/tree/next-gen
# # - git clone -b next-gen [email protected]:WildMeOrg/Wildbook.git && cd Wildbook
# # - ./scripts/build.docker.sh
# image: wildme/edm:latest
# depends_on:
# db:
# condition: service_healthy
# healthcheck:
# test: [ "CMD", "curl", "-f", "http://127.0.0.1:8080/dbconnections.jsp"]
# interval: 10s
# timeout: 5s
# retries: 60
# labels:
# - autoheal=true
# volumes:
# - edm-var:/data/wildbook_data_dir
# networks:
# - intranet
# ports:
# # FIXME: exposed for developer verification
# - "81:8080"
# environment:
# DB_USER: "${WILDBOOK_DB_USER}"
# DB_PASSWORD: "${WILDBOOK_DB_PASSWORD}"
# DB_CONNECTION_URL: "${WILDBOOK_DB_CONNECTION_URL}"
# # Admin user created on startup,
# # https://github.com/WildMeOrg/Wildbook/commit/6d65e70e43691f1b281bb76edf151e5c7cdb7403
# ADMIN_EMAIL: "${EDM_AUTHENTICATIONS_USERNAME__DEFAULT}"
# ADMIN_PASSWORD: "${EDM_AUTHENTICATIONS_PASSWORD__DEFAULT}"
# # JAVA_OPTS from old-world wildbook, which gives us 4G heap memory
# JAVA_OPTS: "-Djava.awt.headless=true -XX:+UseConcMarkSweepGC -Xms4096m -Xmx4096m"
houston:
# https://github.com/WildMeOrg/houston
image: wildme/houston:latest
build: &houston-build
context: .
target: main
command: ["invoke", "app.run"]
depends_on:
db:
condition: service_healthy
elasticsearch:
condition: service_healthy
healthcheck:
test: ['CMD', '/docker-healthcheck.sh']
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes: &houston-volumes
- houston-var:/data
# These are added for development. Do not mount these in production.
- .dockerfiles/docker-entrypoint.sh:/docker-entrypoint.sh
- .dockerfiles/docker-healthcheck.sh:/docker-healthcheck.sh
- .dockerfiles/docker-entrypoint-init.d.codex:/docker-entrypoint-init.d
- .dockerfiles/docker-entrypoint-always-init.d:/docker-entrypoint-always-init.d
# FIXME: pull in development code while working on bringing up the container
- .:/code
networks:
- intranet
- frontend
ports:
# FIXME: exposed for developer verification
- "83:5000"
environment: &houston-environment
HOUSTON_APP_CONTEXT: codex
LOG_FILE: "/data/var/logs/houston.codex.log"
# exposed service is 'localhost' using port 84
SERVER_NAME: "${SERVER_NAME}"
PREFERRED_URL_SCHEME: "${PREFERRED_URL_SCHEME}"
FLASK_ENV: development
SQLALCHEMY_DATABASE_URI: "${SQLALCHEMY_DATABASE_URI}"
TEST_DATABASE_URI: "${TEST_DATABASE_URI}"
EDM_AUTHENTICATIONS_URI__DEFAULT: "${EDM_AUTHENTICATIONS_URI__DEFAULT}"
EDM_AUTHENTICATIONS_USERNAME__DEFAULT: "${EDM_AUTHENTICATIONS_USERNAME__DEFAULT}"
EDM_AUTHENTICATIONS_PASSWORD__DEFAULT: "${EDM_AUTHENTICATIONS_PASSWORD__DEFAULT}"
SAGE_AUTHENTICATIONS_URI__DEFAULT: "${SAGE_AUTHENTICATIONS_URI__DEFAULT}"
SAGE_AUTHENTICATIONS_URI__SYNC: "${SAGE_AUTHENTICATIONS_URI__SYNC}"
ELASTICSEARCH_HOSTS: "${ELASTICSEARCH_HOSTS}"
REDIS_HOST: redis
REDIS_PASSWORD: "seekret_development_password"
GITLAB_PROTO: "${GITLAB_PROTO}"
GITLAB_HOST: "${GITLAB_HOST}"
GITLAB_PORT: "${GITLAB_PORT}"
GITLAB_ADMIN_PASSWORD: "${GITLAB_ADMIN_PASSWORD}"
GITLAB_REMOTE_URI: "${GITLAB_REMOTE_URI}"
GITLAB_REMOTE_LOGIN_PAT: "${GITLAB_REMOTE_LOGIN_PAT}"
GITLAB_NAMESPACE: "${GITLAB_NAMESPACE}"
GIT_SSH_KEY: "${GIT_SSH_KEY}"
GIT_PUBLIC_NAME: "${GIT_PUBLIC_NAME}"
GIT_EMAIL: "${GIT_EMAIL}"
OAUTH_CLIENT_ID: "${HOUSTON_CLIENT_ID}"
OAUTH_CLIENT_SECRET: "${HOUSTON_CLIENT_SECRET}"
OAUTH_USER_EMAIL: "${OAUTH_USER_EMAIL}"
WILDBOOK_DB_HOST: "${WILDBOOK_DB_HOST}"
WILDBOOK_DB_NAME: "${WILDBOOK_DB_NAME}"
WILDBOOK_DB_USER: "${WILDBOOK_DB_USER}"
WILDBOOK_DB_PASSWORD: "${WILDBOOK_DB_PASSWORD}"
LOG_WIDTH: ${LOG_WIDTH}
FLOWER_USER: "${FLOWER_USER}"
FLOWER_PASSWORD: "${FLOWER_PASSWORD}"
TRANSLOADIT_KEY: "${TRANSLOADIT_KEY}"
TRANSLOADIT_TEMPLATE_ID: "${TRANSLOADIT_TEMPLATE_ID}"
TRANSLOADIT_SERVICE: "${TRANSLOADIT_SERVICE}"
GOOGLE_MAPS_API_KEY: "${GOOGLE_MAPS_API_KEY}"
SENTRY_DSN: "${SENTRY_DSN}"
FLATFILE_KEY: "${FLATFILE_KEY}"
RECAPTCHA_PUBLIC_KEY: "${RECAPTCHA_PUBLIC_KEY}"
RECAPTCHA_SECRET_KEY: "${RECAPTCHA_SECRET_KEY}"
DEFAULT_EMAIL_SERVICE: "${DEFAULT_EMAIL_SERVICE}"
DEFAULT_EMAIL_SERVICE_USERNAME: "${DEFAULT_EMAIL_SERVICE_USERNAME}"
DEFAULT_EMAIL_SERVICE_PASSWORD: "${DEFAULT_EMAIL_SERVICE_PASSWORD}"
celery-beat:
image: wildme/houston:latest
build: *houston-build
command: ["celery", "-A", "app.extensions.celery.celery", "beat", "-s", "/data/var/celerybeat-schedule", "-l", "INFO"]
depends_on:
houston:
condition: service_healthy
healthcheck: &celery-healthcheck
test: [ "CMD", "celery", "-A", "app.extensions.celery.celery", "status"]
interval: 30s
timeout: 15s
retries: 60
labels:
- autoheal=true
volumes: *houston-volumes
networks:
- intranet
environment: *houston-environment
celery-worker:
image: wildme/houston:latest
build: *houston-build
command: ["celery", "-A", "app.extensions.celery.celery", "worker", "-l", "INFO", "--pool=gevent", "--task-events"]
depends_on:
houston:
condition: service_healthy
healthcheck: *celery-healthcheck
labels:
- autoheal=true
volumes: *houston-volumes
networks:
- intranet
environment: *houston-environment
celery-worker2:
image: wildme/houston:latest
build: *houston-build
command: ["celery", "-A", "app.extensions.celery.celery", "worker", "-l", "INFO", "--pool=gevent", "--task-events"]
depends_on:
houston:
condition: service_healthy
healthcheck: *celery-healthcheck
labels:
- autoheal=true
volumes: *houston-volumes
networks:
- intranet
environment: *houston-environment
celery-worker3:
image: wildme/houston:latest
build: *houston-build
command: ["celery", "-A", "app.extensions.celery.celery", "worker", "-l", "INFO", "--pool=gevent", "--task-events"]
depends_on:
houston:
condition: service_healthy
healthcheck: *celery-healthcheck
labels:
- autoheal=true
volumes: *houston-volumes
networks:
- intranet
environment: *houston-environment
flower:
image: wildme/houston:latest
build: *houston-build
command: ["celery", "-A", "app.extensions.celery.celery", "flower", "--basic_auth=${FLOWER_USER}:${FLOWER_PASSWORD}"]
depends_on:
houston:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://${FLOWER_USER}:${FLOWER_PASSWORD}@127.0.0.1:5555/metrics"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes: *houston-volumes
networks:
- intranet
environment: *houston-environment
ports:
- "86:5555"
dev-frontend:
# this component is intended to only be used in development
image: node:lts
working_dir: /code
entrypoint: "/docker-entrypoint.sh"
healthcheck:
test: [ "CMD", "curl", "-f", "http://127.0.0.1:3000/"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes:
- .dockerfiles/dev-frontend/docker-entrypoint.sh:/docker-entrypoint.sh
- ./:/code
networks:
- intranet
environment:
HOUSTON_APP_CONTEXT: codex
# See port served by 'www' component (i.e. the reverse proxy)
HOST: "0.0.0.0"
PORT: "84"
localhost:
image: nginx:latest
depends_on:
#edm:
# condition: service_healthy
# sage:
# condition: service_healthy
houston:
condition: service_healthy
dev-frontend:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:84/"]
interval: 10s
timeout: 5s
retries: 60
labels:
- autoheal=true
volumes:
- .dockerfiles/www/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- intranet
- frontend
ports:
# BBB deprecated in favor or port 80, remains for backward compat
- "84:80"
autoheal:
image: willfarrell/autoheal
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
AUTOHEAL_CONTAINER_LABEL: "autoheal"
AUTOHEAL_INTERVAL: 15
AUTOHEAL_START_PERIOD: 600
AUTOHEAL_DEFAULT_STOP_TIMEOUT: 60
restart: always
networks:
intranet:
frontend:
volumes:
db-pgdata-var:
# edm-var:
es-var1:
es-var2:
es-var3:
redis-var:
sage-database-var:
sage-cache-var:
houston-var: