-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
104 lines (97 loc) · 2.55 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
services:
db:
image: postgres:16
restart: unless-stopped
env_file: .env.docker
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready
start_period: 5s
interval: 5s
timeout: 5s
retries: 3
server:
image: mtsrus/data-rentgen:develop
command: python -m data_rentgen.server --host 0.0.0.0 --port 8000
restart: unless-stopped
env_file: .env.docker
ports:
- 8000:8000
# PROMETHEUS_MULTIPROC_DIR is required for multiple workers, see:
# https://prometheus.github.io/client_python/multiprocess/
environment:
PROMETHEUS_MULTIPROC_DIR: /tmp/prometheus-metrics
# tmpfs dir is cleaned up each container restart
tmpfs:
- /tmp/prometheus-metrics
healthcheck:
test: [CMD-SHELL, curl -f http://localhost:8000/monitoring/ping]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
depends_on:
db:
condition: service_healthy
db-migration:
condition: service_completed_successfully
broker:
image: bitnami/kafka:3.7
restart: unless-stopped
env_file: .env.docker
ports:
- 9093:9093
volumes:
- kafka_data:/bitnami/kafka
healthcheck:
test: [CMD-SHELL, kafka-topics.sh --bootstrap-server 127.0.0.1:9095 --list]
interval: 10s
timeout: 5s
retries: 5
consumer:
image: mtsrus/data-rentgen:develop
command: python -m data_rentgen.consumer
restart: unless-stopped
env_file: .env.docker
depends_on:
broker:
condition: service_healthy
db-migration:
condition: service_completed_successfully
db-migration:
image: mtsrus/data-rentgen:develop
command: |
python -m data_rentgen.db.migrations upgrade head && python -m data_rentgen.db.scripts.create_partitions
env_file: .env.docker
depends_on:
db:
condition: service_healthy
db-views:
image: mtsrus/data-rentgen:develop
command: |
python -m data_rentgen.db.scripts.create_analytic_views
env_file: .env.docker
depends_on:
db-migration:
condition: service_completed_successfully
frontend:
image: mtsrus/data-rentgen-ui:develop
restart: unless-stopped
env_file: .env.docker
ports:
- 3000:3000
healthcheck:
test: [CMD-SHELL, curl -f http://localhost:3000/]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
depends_on:
server:
condition: service_healthy
volumes:
postgres_data:
kafka_data: