-
Notifications
You must be signed in to change notification settings - Fork 4
/
compose.yml
357 lines (336 loc) · 8.77 KB
/
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
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
version: '3.7'
volumes:
pg-backend:
pg-sources:
pg-notifications:
redis:
zookeeper:
kafka:
services:
backend-db:
restart: on-failure
image: docker.io/postgres:15.1
profiles:
- backend
- backend-dev
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d provisioning -U postgres && sleep 5" ]
interval: 2s
timeout: 3s
retries: 10
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=provisioning
volumes:
- pg-backend:/var/lib/postgresql/data
expose:
- 5432
redis:
image: docker.io/redis:latest
profiles:
- redis
- sources
- backend
- backend-dev
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 2s
timeout: 2s
retries: 10
expose:
- 6379
volumes:
- redis:/data
zookeeper:
profiles:
- kafka
image: quay.io/strimzi/kafka:latest-kafka-3.4.0
command:
[
"sh",
"-c",
"bin/zookeeper-server-start.sh config/zookeeper.properties"
]
expose:
- "2181"
environment:
LOG_DIR: /tmp/logs
volumes:
- zookeeper:/tmp/logs
kafka:
profiles:
- kafka
image: quay.io/strimzi/kafka:latest-kafka-3.4.0
command:
[
"sh",
"-c",
"bin/kafka-server-start.sh config/server.properties --override inter.broker.listener.name=$${KAFKA_INTER_BROKER_LISTENER_NAME} --override listener.security.protocol.map=$${KAFKA_LISTENER_SECURITY_PROTOCOL_MAP} --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}"
]
expose:
- 9092
- 29092
depends_on:
- zookeeper
environment:
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
LOG_DIR: "/tmp/logs"
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT,LOCALHOST:PLAINTEXT
KAFKA_LISTENERS: DOCKER://kafka:29092,LOCALHOST://localhost:9092
KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka:29092,LOCALHOST://localhost:9092
ports:
- ${EXPOSED_KAFKA_PORT:-9092}:29092
- ${EXPOSED_KAFKA_PORT2:-29092}:29092
volumes:
- kafka:/tmp/logs
init-kafka:
profiles:
- kafka
image: quay.io/strimzi/kafka:latest-kafka-3.4.0
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
# blocks until kafka is reachable
bin/kafka-topics.sh --bootstrap-server kafka:29092 --list
echo -e 'Creating kafka topics'
bin/kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic platform.sources.status --replication-factor 1 --partitions 1
bin/kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic platform.provisioning.internal.availability-check --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
bin/kafka-topics.sh --bootstrap-server kafka:29092 --list
"
depends_on:
- kafka
- zookeeper
backend:
profiles:
- backend
env_file:
- backend.env
depends_on:
backend-db:
condition: service_healthy
init-kafka:
condition: service_completed_successfully
entrypoint:
- bash
- "-c"
- "/pbackend migrate && /pbackend api"
image: quay.io/cloudservices/provisioning-backend:latest
ports:
- ${EXPOSED_APP_PORT:-8000}:${APP_PORT:-8000}
- ${EXPOSED_PROMETHEUS_PORT:-9000}:${PROMETHEUS_PORT:-9000}
backend-dev:
profiles:
- backend-dev
env_file:
- backend.env
depends_on:
backend-db:
condition: service_healthy
init-kafka:
condition: service_completed_successfully
build:
context: ./backend
dockerfile: ../Dockerfile.backend.dev
ports:
- ${EXPOSED_APP_PORT:-8000}:${APP_PORT:-8000}
- ${EXPOSED_PROMETHEUS_PORT:-9000}:${PROMETHEUS_PORT:-9000}
volumes:
- ./backend/:/backend
statuser-dev:
profiles:
- statuser-dev
env_file:
- backend.env
depends_on:
- backend-dev
- kafka
build:
context: ./backend
dockerfile: ../Dockerfile.statuser.dev
ports:
- ${EXPOSED_PROMETHEUS_PORT:-9005}:${PROMETHEUS_PORT:-9000}
volumes:
- ./backend/:/statuser
worker-dev:
profiles:
- worker-dev
env_file:
- backend.env
depends_on:
- backend-dev
- redis
build:
context: ./backend
dockerfile: ../Dockerfile.worker.dev
ports:
- ${EXPOSED_PROMETHEUS_PORT:-9010}:${PROMETHEUS_PORT:-9000}
volumes:
- ./backend/:/worker
frontend-dev:
profiles:
- frontend-dev
environment:
- PROV_API_HOST=backend-dev
- WATCHPACK_POLLING=true
build:
context: ./frontend
dockerfile: ../Dockerfile.frontend.dev
volumes:
- ./frontend/:/frontend
ports:
- ${EXPOSED_FRONTEND_DEV_PORT:-1337}:${FRONTEND_DEV_PORT:-1337}
depends_on:
- backend-dev
sources:
profiles:
- sources
image: quay.io/cloudservices/sources-api-go:latest
env_file:
- sources.env
expose:
- 8131
depends_on:
redis:
condition: service_healthy
sources-db:
condition: service_healthy
ports:
- ${EXPOSED_SOURCES_PORT:-8131}:${PORT:-8131}
sources-dev:
profiles:
- sources-dev
build:
context: sources-api-go
ports:
- ${EXPOSED_SOURCES_DEV_PORT:-8131}:${SOURCES_PORT:-8131}
env_file:
- sources.env
depends_on:
redis:
condition: service_healthy
sources-db:
condition: service_healthy
sources-db:
restart: on-failure
profiles:
- sources
- sources-dev
image: docker.io/postgres:13.1
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 2s
timeout: 2s
retries: 10
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=sources_devel
volumes:
- pg-sources:/var/lib/postgresql/data
expose:
- 5432
notifications-db:
restart: on-failure
profiles:
- notifications
image: docker.io/postgres:13.1
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 2s
timeout: 2s
retries: 10
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=notifications
volumes:
- pg-notifications:/var/lib/postgresql/data
expose:
- 5432
notifications-backend:
profiles:
- notifications
env_file:
- notifications-backend.env
healthcheck:
# No ping nor health endpoint
test:
[
"CMD",
"curl",
"-f",
"http://localhost:8085/openapi.json"
]
interval: 20s
timeout: 10s
retries: 3
build:
context: ./notifications
dockerfile: ../notifications_seed/Dockerfile.notifications-backend
ports:
- ${EXPOSED_NOTIFICATIONS_PORT:-8085}:${NOTIFICATIONS_PORT:-8085}
depends_on:
notifications-db:
condition: service_healthy
redis:
condition: service_healthy
notification-engine:
profiles:
- notifications
env_file:
- notifications-engine.env
build:
context: ./notifications
dockerfile: ../notifications_seed/Dockerfile.notifications-engine
expose:
- 8087
depends_on:
init-kafka:
condition: service_completed_successfully
notifications-db:
condition: service_healthy
notifications-seeder:
profiles:
- notifications-init
env_file:
- notifications-backend.env
build:
context: .
dockerfile: ./notifications_seed/Dockerfile.notifications.seed
depends_on:
notifications-backend:
condition: service_healthy
image-builder-frontend:
profiles:
- image-builder-frontend
build:
context: ./image-builder-frontend
dockerfile: ./distribution/Dockerfile
environment:
- LOCAL_API=provisioning:8003~http~frontend-static
depends_on:
- frontend-static
volumes:
- ./image-builder-frontend/:/usr/src/app
ports:
- ${EXPOSED_IMAGE_BUILDER_PORT:-1337}:${IMAGE_BUILDER_PORT:-1337}
entrypoint: [ "npm", "run", "stage-beta" ]
frontend-static:
profiles:
- image-builder-frontend
environment:
- BETA=true
build:
context: ./frontend
dockerfile: ../Dockerfile.frontend.dev
volumes:
- ./frontend/:/frontend
entrypoint: [ "npm", "run", "start:federated" ]
ports:
- ${EXPOSED_FRONTEND_STATIC_PORT:-8003}:${FRONTEND_STATIC_PORT:-8003}