-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
200 lines (186 loc) · 5.05 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
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
version: "3"
services:
# Database instance.
db:
image: "postgres:16"
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- tamato-data-volume:/var/lib/postgresql/data
ports:
- "127.0.0.1:5431:5432"
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
shm_size: 32g
stdin_open: true
tty: true
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# Redis instance used as a Django cache store.
cache-redis:
image: redis
ports:
- "127.0.0.1:6379:6379"
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
# Redis instance used as Celery's broker instance.
celery-redis:
image: redis
ports:
- "127.0.0.1:6378:6379"
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
# General purpose Celery worker - notifications, publishing and sqlite snapshots.
celery:
build:
context: .
args:
- "ENV=${ENV:-prod}"
volumes:
- ./:/app/
command: sh -c "celery -A common.celery worker -O fair -l info -Q standard"
env_file:
- .env
- settings/envs/docker.env
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stdin_open: true
tty: true
depends_on:
- celery-redis
healthcheck:
test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
interval: 10s
timeout: 5s
retries: 2
start_period: 5s
# Celery worker used to execute business rule checks on workbaskets.
rule-check-celery:
build:
context: .
args:
- "ENV=${ENV:-prod}"
volumes:
- ./:/app/
command: sh -c "celery -A common.celery worker -O fair -l info -Q rule-check --concurrency 1"
env_file:
- .env
- settings/envs/docker.env
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stdin_open: true
tty: true
depends_on:
- celery-redis
healthcheck:
test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
interval: 10s
timeout: 5s
retries: 2
start_period: 5s
# Celery worker for bulk creating and editing of objects.
bulk-create-celery:
build:
context: .
args:
- "ENV=${ENV:-prod}"
volumes:
- ./:/app/
command: sh -c "celery -A common.celery worker -O fair -l info -Q bulk-create --concurrency 1"
env_file:
- .env
- settings/envs/docker.env
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stdin_open: true
tty: true
depends_on:
- celery-redis
healthcheck:
test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
interval: 10s
timeout: 5s
retries: 2
start_period: 5s
# Celery worker used to execute importer parser and objection creation.
importer-celery:
build:
context: .
args:
- "ENV=${ENV:-prod}"
volumes:
- ./:/app/
command: sh -c "celery -A common.celery worker -O fair -l info -Q importer --concurrency 1"
env_file:
- .env
- settings/envs/docker.env
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
depends_on:
- celery-redis
healthcheck:
test: [ "CMD-SHELL", "python -m dbt_copilot_python.celery_health_check.healthcheck" ]
interval: 10s
timeout: 5s
retries: 2
start_period: 5s
# Celery Beat process, used to execute scheduled, cron-like tasks.
celery-beat:
build:
context: .
args:
- "ENV=${ENV:-prod}"
volumes:
- ./:/app/
command: sh -c "celery -A common.celery beat -l info"
env_file:
- .env
- settings/envs/docker.env
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stdin_open: true
tty: true
depends_on:
- celery-redis
# Minio object store instance providing S3-like APIs and capabilities.
s3:
image: minio/minio
ports:
- "127.0.0.1:9000:9000"
- "127.0.0.1:9001:9001"
volumes:
- tamato-s3-volume:/data
env_file: .env
entrypoint: sh
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
command: -c "mkdir -p /data/importer && mkdir -p /data/hmrc-packaging && minio server --quiet /data --console-address ':9001'"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# Web application process.
tamato:
build:
context: .
args:
- "ENV=${ENV:-prod}"
image: tamato
volumes:
- "${DOCKER_WEB_VOLUME:-./:/app/}"
ports:
- "127.0.0.1:8000:8000"
depends_on:
- db
- cache-redis
- celery-redis
- celery
- rule-check-celery
- importer-celery
#- celery-beat # Normally only required in production environments.
- s3
env_file:
- .env
- settings/envs/docker.env
command: sh -c "python manage.py runserver 0.0.0.0:8000"
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stdin_open: true
tty: true
volumes:
tamato-data-volume: {}
tamato-s3-volume: {}