-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
112 lines (97 loc) · 2.52 KB
/
docker-compose.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
version: "3.9"
# Run two instances of `sample-project`
#
# Instance #1:
# - Accessible at http://localhost:8001
# - Uses `celery` and `RabbitMQ` to handle webmentions.
#
# Instance #2:
# - Accessible at http://localhost:8002
# - Uses `cron` to handle webmentions, scheduled to run every minute.
# - Also uses Wagtail.
#
# - Each instance can send mentions to the other one
# - Each instance has a cron job which has a chance of sending a mention to the
# other each minute.
x-healthy: &healthy
interval: 10s
timeout: 2s
retries: 3
start_period: 20s
x-database: &database
image: postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
<<: *healthy
x-app-volumes: &app-volumes
volumes:
- ./sample-project:/project
- ./mentions:/project/mentions
x-with-celery: &with-celery
env_file:
- ./sample-project/docker/.env
- ./sample-project/docker/with-celery/.env
x-with-wagtail: &with-wagtail
env_file:
- ./sample-project/docker/.env
- ./sample-project/docker/with-wagtail/.env
services:
# This version uses Celery
with-celery-db:
<<: [*with-celery, *database]
with-celery-rabbitmq:
image: rabbitmq:3-alpine
<<: *with-celery
healthcheck:
test: rabbitmq-diagnostics -q ping
<<: *healthy
ports:
- "5672"
with-celery-web.org:
<<: [*with-celery, *app-volumes]
build:
target: with_celery
depends_on:
with-celery-db:
condition: service_healthy
healthcheck:
test: "curl --fail http://localhost"
ports:
- "8001:80"
with-celery-celery:
<<: [*with-celery, *app-volumes]
build:
target: with_celery_celery
depends_on:
with-celery-rabbitmq:
condition: service_healthy
with-celery-web.org:
condition: service_healthy
with-celery-cron:
<<: [*with-celery, *app-volumes]
build:
target: with_celery_cron
depends_on:
with-celery-web.org:
condition: service_healthy
# This version uses Wagtail and does not use Celery
with-wagtail-db:
<<: [*with-wagtail, *database]
with-wagtail-web.org:
<<: [*with-wagtail, *app-volumes]
build:
target: with_wagtail
depends_on:
with-wagtail-db:
condition: service_healthy
healthcheck:
test: "curl --fail http://localhost"
ports:
- "8002:80"
with-wagtail-cron:
<<: [*with-wagtail, *app-volumes]
build:
target: with_wagtail_cron
depends_on:
with-wagtail-web.org:
condition: service_healthy