-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
586 lines (539 loc) · 15.9 KB
/
docker-compose.yml
File metadata and controls
586 lines (539 loc) · 15.9 KB
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
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
services:
#########################
# BMO
#########################
bmo.test:
platform: linux/amd64
build:
context: ../bmo/
dockerfile: ./Dockerfile
command: demo
volumes:
- bmo-data-dir:/app/data
environment: &bmo_env
BMO_db_host: bmo.db
BMO_db_name: bugs
BMO_db_pass: bugs
BMO_db_user: bugs
BMO_inbound_proxies: "*"
BMO_memcached_namespace: bugzilla
BMO_memcached_servers: memcached:11211
BMO_urlbase: http://bmo.test/
BUGZILLA_ALLOW_INSECURE_HTTP: 1
BZ_ANSWERS_FILE: /app/conf/checksetup_answers_suite.txt
CONDUIT_USER_API_KEY: zQ5TSBzq7tTZMtKYq9K1ZqJMjifKx3cPL7pIGk9Q
CONDUIT_USER_LOGIN: conduit@mozilla.bugs
CONDUIT_USER_PASSWORD: password123456789!
HTTP_BACKEND: simple
HTTPD_MaxClients: 1
HTTPD_MaxRequestsPerChild: 4000
HTTPD_MaxSpareServers: 1
HTTPD_MinSpareServers: 1
HTTPD_ServerLimit: 1
HTTPD_StartServers: 1
LOCALCONFIG_ENV: 1
LOG4PERL_CONFIG_FILE: log4perl-suite.conf
LOGGING_PORT: 5880
PHABRICATOR_API_KEY: api-qdaethogwpld3wmn2cnhbh57wkux
PHABRICATOR_APP_ID: 66365490f364fbafba439619f0f31b7a4a0d73528c485520adf3b295f934acda
PHABRICATOR_AUTH_CALLBACK_URL: http://phabricator.test/auth/login/bmo:bmo.test/
PHABRICATOR_BOT_API_KEY: 8G4ly8JkxbypZgh5XrdiHWExVEjPq5S3HvMBll1K
PHABRICATOR_BOT_LOGIN: phab-bot@bmo.tld
PHABRICATOR_BOT_PASSWORD: password123456789!
PHABRICATOR_OAUTH_ID: 6iaYNVorOeYQaQ5vkwyC
PHABRICATOR_OAUTH_SECRET: QNzdU5eRuhlHotvkh8KBgtR3yqxMG3czKfNks1qt
PORT: 80
healthcheck:
test: ["CMD", "curl", "-sfk", "http://localhost", "-o/dev/null"]
depends_on:
bmo.db:
condition: service_healthy
memcached:
condition: service_started
tinyproxy:
condition: service_started
bmo.feed:
platform: linux/amd64
build:
context: ../bmo/
dockerfile: ./Dockerfile
command: perl extensions/PhabBugz/bin/phabbugz_feed.pl start -d -f
volumes:
- bmo-data-dir:/app/data
environment: *bmo_env
restart: on-failure
depends_on:
- phabricator.test
- bmo.db
- memcached
bmo.pushd:
platform: linux/amd64
build:
context: ../bmo/
dockerfile: ./Dockerfile
command: perl extensions/Push/bin/bugzilla-pushd.pl start -d -f
volumes:
- bmo-data-dir:/app/data
environment: *bmo_env
restart: on-failure
depends_on:
- phabricator.test
- bmo.db
- memcached
bmo.db:
platform: linux/amd64
image: mysql:8
volumes:
- bmo-mysql-db:/var/lib/mysql
- "./docker/bmo/mysql:/etc/mysql/conf.d"
tmpfs:
- /tmp
logging:
driver: "none"
environment:
MYSQL_DATABASE: bugs
MYSQL_USER: bugs
MYSQL_PASSWORD: bugs
MYSQL_ALLOW_EMPTY_PASSWORD: 1
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-ubugs", "-pbugs"]
timeout: 180s
memcached:
platform: linux/amd64
image: memcached:latest
###########################
# Git-Hg-Sync
###########################
git_hg_sync-cinnabar_init:
platform: linux/amd64
user: 101:101 # match the owner in the Cgit container
build:
context: ../git-hg-sync
volumes:
- ./docker/git-hg-sync/scripts:/scripts:ro
- git-repos:/opt/git
- cgit-cache:/opt/cgit/cache # we need access to this so we can clear the cache
entrypoint: ["/scripts/cinnabar-init.sh"]
depends_on:
autoland.hg.test:
condition: service_healthy
git.test:
condition: service_healthy
git_hg_sync:
platform: linux/amd64
build:
context: ../git-hg-sync
command: --config /app/config-suite.toml
volumes:
- ../git-hg-sync:/app:z
- ./ssh:/app/.ssh:z
- ./docker/git-hg-sync/config-suite.toml:/app/config-suite.toml
- git_hg_sync_clones:/clones
environment: &pulse_env
PULSE_HOST: pulse.test
PULSE_PORT: 5672
PULSE_QUEUE: queue/suite/git-hg-sync
PULSE_EXCHANGE: exchange/suite/git-hg-sync
PULSE_ROUTING_KEY: git-hg-sync
PULSE_SSL: "" # False
# Same as the lando.hg-landing_worker
SSH_PRIVATE_KEY: |
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIMiMNKEkf0vr4HrhUIrq0e9NjGNPArN7L1uy/HQZ1dA8oAoGCCqGSM49
AwEHoUQDQgAEdakNgjerNLFXy1uMfwLjPd5/pBTbIEoZMdMV/o6s+uoMg776LF+v
gtbfIaZbhDcJElzHwpnqGfHYU+cM4KyurA==
-----END EC PRIVATE KEY-----
PYTHONTRACEMALLOC: 1
depends_on:
git_hg_sync-cinnabar_init:
condition: service_completed_successfully
pulse.test:
condition: service_healthy
#########################
# Lando
#########################
lando:
platform: linux/amd64
build:
context: ../lando/.
image: suite_lando
stdin_open: true
tty: true
environment: &lando-env
# To simulate a remote environment, uncomment the following lines...
# ENVIRONMENT: development
# DJANGO_SETTINGS_MODULE: lando.remote_settings
# ... and comment this one.
ENVIRONMENT: local
#
# This will likely trigger errors when running the `setup_dev` and
# `collectstatic` commands below. They need to be manually disabled
# during such a simulation.
<<: *pulse_env
DJANGO_LOG_LEVEL: debug
LOG_LEVEL: INFO
DEFAULT_DB_HOST: lando.db
PHABRICATOR_URL: http://phabricator.test
PHABRICATOR_UNPRIVILEGED_API_KEY: api-qdaethogwpld3wmn2cnhbh57wkux
TREESTATUS_URL: https://treestatus.mozilla-releng.net
# DATA_UPLOAD_MAX_MEMORY_SIZE: 10
#
# lando-web-dev-mozilla github app
# GITHUB_APP_ID: ...
# GITHUB_APP_PRIVKEY: |
# ...
env_file: ../lando/.env
command: bash -c "
echo "version=0" > src/lando/version.py &&
lando generate_version_file &&
lando collectstatic --clear --no-input &&
lando setup_dev &&
lando runserver 0.0.0.0:80"
user: "${UID:-}:${GID:-}" # needed for file generation in the mounted volumes
depends_on:
lando.db:
condition: service_healthy
git_hg_sync-cinnabar_init:
condition: service_completed_successfully
lando.redis:
condition: service_healthy
phabricator.test:
condition: service_healthy
volumes:
- ../lando:/code
- ../lando/staticfiles:/code/staticfiles
- ../lando-prorotype/media:/mediafiles
healthcheck:
test: ["CMD", "curl", "-sfko/dev/null", "http://localhost/__heartbeat__"]
interval: 10s
timeout: 60s
retries: 6
lando.hg-landing-worker: &worker
platform: linux/amd64
image: suite_lando
user: "${UID:-}:${GID:-}" # needed for file generation in the mounted volumes
environment: &worker-env
<<: *lando-env
DEFAULT_GRACE_SECONDS: 10
LANDING_WORKER_USERNAME: app
LANDING_WORKER_TARGET_SSH_PORT: 8022
SSH_PRIVATE_KEY: |
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIMiMNKEkf0vr4HrhUIrq0e9NjGNPArN7L1uy/HQZ1dA8oAoGCCqGSM49
AwEHoUQDQgAEdakNgjerNLFXy1uMfwLjPd5/pBTbIEoZMdMV/o6s+uoMg776LF+v
gtbfIaZbhDcJElzHwpnqGfHYU+cM4KyurA==
-----END EC PRIVATE KEY-----
command: lando start_landing_worker hg
volumes:
- ../lando:/code
restart: on-failure
depends_on:
lando:
condition: service_healthy
lando.db:
condition: service_healthy
lando.git-landing-worker: &git-worker
<<: *worker
#environment:
# <<: *worker-env
#
# lando-dev-mozilla github-app
# GITHUB_APP_ID: ...
# GITHUB_APP_PRIVKEY: |
# ...
command: lando start_landing_worker git
lando.git-automation-worker:
<<: *git-worker
command: lando start_automation_worker git-automation-worker
lando.db:
platform: linux/amd64
image: postgres:17
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- lando-postgres-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 1s
timeout: 1s
retries: 10
lando.redis:
platform: linux/amd64
image: redis:7.2
healthcheck:
test: ["CMD", "redis-cli", "ping"]
lando.celery:
platform: linux/amd64
image: suite_lando
command: lando start_celery_worker
depends_on:
lando.redis:
condition: service_healthy
###############################
# Phabricator
###############################
phabricator:
platform: linux/amd64
build:
context: ../phabricator/
dockerfile: ./Dockerfile
target: development
entrypoint: /app/entrypoint.sh
command: dev_start
environment:
MYSQL_HOST: phab.db
MYSQL_PORT: 3306
MYSQL_USER: root
MYSQL_PASS: password
PHABRICATOR_URI: http://phabricator.test/
PHABRICATOR_CDN_URI: http://phabricator.test/
BUGZILLA_URL: http://bmo.test
BUGZILLA_AUTOMATION_USER: phab-bot@bmo.tld
BUGZILLA_AUTOMATION_API_KEY: 8G4ly8JkxbypZgh5XrdiHWExVEjPq5S3HvMBll1K
volumes:
- phabricator-nginx:/app/nginx
- ../phabricator/src:/app/phabricator/src
- ../phabricator/moz-extensions:/app/moz-extensions
restart: on-failure
depends_on:
phab.db:
condition: service_healthy
phab.db:
platform: linux/amd64
image: mysql:5.7
volumes:
- phabricator-mysql-db:/var/lib/mysql
- ./docker/phabricator/mysql:/etc/mysql/conf.d:ro
- ./docker/phabricator/demo.sql.gz:/docker-entrypoint-initdb.d/demo.sql.gz
environment:
- MYSQL_ROOT_PASSWORD=password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-ppassword"]
interval: 10s
timeout: 120s
retries: 13
restart: on-failure
###############################
# Mercurial repositories
###############################
autoland.treestatus:
platform: linux/amd64
image: mozilla/autolandtreestatus:latest
restart: always
autoland.hg-init:
platform: linux/amd64
image: mozilla/autolandhg:latest
build:
context: ../conduit-autoland-hg
dockerfile: ./Dockerfile
environment:
ARCCONFIG: y
PHABRICATOR_URI: http://phabricator.test
command: init
volumes:
- autoland-hg:/repos
autoland.hg:
platform: linux/amd64
image: mozilla/autolandhg:latest
build:
context: ../conduit-autoland-hg
dockerfile: ./Dockerfile
command: start
restart: always
environment:
SSH_PUBLIC_KEY: "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHWpDYI3qzSxV8tbjH8C4z3ef6QU2yBKGTHTFf6OrPrqDIO++ixfr4LW3yGmW4Q3CRJcx8KZ6hnx2FPnDOCsrqw="
volumes:
- autoland-hg:/repos
depends_on:
- autoland.hg-init
###############################
# Phabricator-Emails
###############################
phabricator-emails-prepare: &defconf
platform: linux/amd64
build:
context: ../phabricator-emails
volumes:
# Due to the current way the container is built, mounting the current source code is not sufficient
# - ../phabricator-emails/:/app/:z
- ./docker/phabricator-emails/settings.suite.ini:/app/.local/lib/python3.10/site-packages/settings.ini:z
command: prepare
depends_on:
phabricator.test:
condition: service_healthy
phabricator-emails.db:
condition: service_healthy
phabricator-emails-migrate:
<<: *defconf
command: migrate
depends_on:
phabricator-emails-prepare:
condition: service_completed_successfully
phabricator-emails:
<<: *defconf
command: service
depends_on:
phabricator-emails-migrate:
condition: service_completed_successfully
phabricator-emails.db:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- phabricator-emails-postgres-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
interval: 1s
timeout: 1s
retries: 10
###########################
# Git repositories
###########################
cgit-init: &cgit-config
platform: linux/amd64
build:
context: ../cgit-docker
volumes:
- ./docker/cgit/scripts:/scripts:ro
- git-repos:/opt/git
- cgit-cache:/opt/cgit/cache
command: /scripts/conduit-init.sh
git.test:
<<: *cgit-config
container_name: git.test
command: ""
environment:
GIT_USER: lando
# 'password'
# generate with `htpasswd -n user | cut -d: -f2`
# escape `$`s by doubling them
GIT_PASSWORD: "$$apr1$$SnBWPBBG$$SucMwESCPMq5TmzS6mUeB1"
healthcheck:
test: ["CMD", "curl", "-sfk", "http://localhost", "-o/dev/null"]
depends_on:
cgit-init:
condition: service_completed_successfully
###########################
# LOCAL-DEV
# Provide an ability to run all CLI developer needs:
# * CVS push/pull to autoland.hg
# * moz-phab to phabricator.test
###########################
local-dev:
platform: linux/amd64
build:
context: docker/local-dev
dockerfile: ./Dockerfile
environment:
HTTP_ALLOWED: 1
LANDO_TRY_CONFIG: lando-suite
command: bash -c "cd review && pip3 install -e . && cd ~ && bash"
volumes:
- local-dev:/home/phab
- ../review:/home/phab/review
depends_on:
- tinyproxy
- phabricator.test
- bmo.test
- bmo.feed
- bmo.pushd
- autoland.hg.test
###########################
# Pulse
###########################
pulse.test:
platform: linux/amd64
image: rabbitmq:4-management-alpine
volumes:
- ./docker/rabbitmq/90-definitions-import.conf:/etc/rabbitmq/conf.d/90-definitions-import.conf
- ./docker/rabbitmq/definitions.json:/etc/rabbitmq/definitions.json
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 5s
retries: 1
###########################
# Proxies
###########################
tinyproxy:
platform: linux/amd64
build:
context: docker/tinyproxy
dockerfile: ./Dockerfile
ports:
- "1080:1080"
phabricator.test:
platform: linux/amd64
image: nginx:alpine
volumes:
- "./docker/phabricator/site.conf:/etc/nginx/conf.d/default.conf:ro"
- phabricator-nginx:/app/nginx
restart: on-failure
healthcheck:
test:
[
"CMD",
"curl",
"-sfk",
"http://localhost",
"-H",
"Host: phabricator.test",
"-o/dev/null",
]
depends_on:
- phabricator
- tinyproxy
lando.test:
platform: linux/amd64
build: ../lando/nginx
depends_on:
- lando
- tinyproxy
volumes:
- ../lando/staticfiles:/code/staticfiles
- ../lando/media:/mediafiles
autoland.hg.test:
platform: linux/amd64
image: nginx:alpine
container_name: hg.test
volumes:
- "./docker/autoland-hg/site.conf:/etc/nginx/conf.d/default.conf:ro"
- autoland-hg:/repos
restart: on-failure
healthcheck:
test: ["CMD", "curl", "-sfk", "http://localhost", "-o/dev/null"]
depends_on:
- autoland.hg
- tinyproxy
product-details.test:
platform: linux/amd64
image: nginx:alpine
container_name: product-details.test
volumes:
- ./docker/product-details/site.conf:/etc/nginx/conf.d/default.conf:ro
- ./docker/product-details/1.0:/www/data/1.0
restart: on-failure
depends_on:
- tinyproxy
###########################
# Volumes
###########################
volumes:
autoland-hg:
bmo-data-dir:
bmo-mysql-db:
caches_cache:
cgit-cache:
git-repos:
git_hg_sync_clones:
lando-postgres-db:
local-dev:
media:
phabricator-emails-postgres-db:
phabricator-mysql-db:
phabricator-nginx: