-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (128 loc) · 3.21 KB
/
docker-compose.yml
File metadata and controls
135 lines (128 loc) · 3.21 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
services:
db:
image: postgres:17
restart: unless-stopped
environment:
POSTGRES_DB: syncmaster
POSTGRES_USER: syncmaster
POSTGRES_PASSWORD: changeme
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [CMD-SHELL, 'pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}']
start_period: 5s
interval: 30s
timeout: 5s
retries: 3
db-migrations:
image: mtsrus/syncmaster-server:${VERSION:-develop}
restart: no
build:
dockerfile: docker/Dockerfile.server
context: .
target: prod
entrypoint: [python, -m, syncmaster.db.migrations, upgrade, head]
volumes:
- ./config.docker.yml:/app/config.yml
depends_on:
db:
condition: service_healthy
rabbitmq:
image: rabbitmq:4
restart: unless-stopped
ports:
- 5672:5672
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: rabbitmq-diagnostics -q ping
start_period: 5s
interval: 30s
timeout: 5s
retries: 3
server:
image: mtsrus/syncmaster-server:${VERSION:-develop}
restart: unless-stopped
build:
dockerfile: docker/Dockerfile.server
context: .
target: prod
ports:
- 8000:8000
environment:
# PROMETHEUS_MULTIPROC_DIR is required for multiple workers, see:
# https://prometheus.github.io/client_python/multiprocess/
PROMETHEUS_MULTIPROC_DIR: /tmp/prometheus-metrics
# tmpfs dir is cleaned up each container restart
tmpfs:
- /tmp/prometheus-metrics:mode=1777
volumes:
- ./config.docker.yml:/app/config.yml
depends_on:
db:
condition: service_healthy
db-migrations:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
profiles:
- server
- frontend
- all
worker:
image: mtsrus/syncmaster-worker:${VERSION:-develop}
restart: unless-stopped
build:
dockerfile: docker/Dockerfile.worker
context: .
target: prod
command: worker --events --queues 123-test_queue # Queue.slug must be created in advance!
volumes:
- ./config.docker.yml:/app/config.yml
depends_on:
db:
condition: service_healthy
db-migrations:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
profiles:
- worker
- all
scheduler:
image: mtsrus/syncmaster-scheduler:${VERSION:-develop}
restart: unless-stopped
build:
dockerfile: docker/Dockerfile.scheduler
context: .
target: prod
volumes:
- ./config.docker.yml:/app/config.yml
depends_on:
db:
condition: service_healthy
db-migrations:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
profiles:
- scheduler
- all
frontend:
image: mtsrus/syncmaster-ui:${VERSION:-develop}
restart: unless-stopped
volumes:
- ./config.docker.yml:/app/config.yml
ports:
- 3000:3000
depends_on:
server:
condition: service_healthy
profiles:
- frontend
- all
volumes:
postgres_data:
rabbitmq_data: