-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
111 lines (105 loc) · 2.69 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
services:
db:
image: postgres
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: 30s
timeout: 5s
retries: 3
rabbitmq:
image: rabbitmq
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
migrations:
image: mtsrus/syncmaster-server:${TAG:-develop}
restart: no
build:
dockerfile: docker/Dockerfile.server
context: .
target: prod
entrypoint: [python, -m, syncmaster.db.migrations, upgrade, head]
env_file: .env.docker
depends_on:
db:
condition: service_healthy
server:
image: mtsrus/syncmaster-server:${TAG:-develop}
restart: unless-stopped
build:
dockerfile: docker/Dockerfile.server
context: .
target: prod
ports:
- 8000:8000
environment:
# list here usernames which should be assigned SUPERUSER role on application start
SYNCMASTER__ENTRYPOINT__SUPERUSERS: admin
# 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
env_file: .env.docker
depends_on:
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
healthcheck:
test: [CMD-SHELL, curl -f http://localhost:8000/monitoring/ping]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
worker:
image: mtsrus/syncmaster-worker:${TAG:-develop}
restart: unless-stopped
build:
dockerfile: docker/Dockerfile.worker
context: .
target: prod
env_file: .env.docker
depends_on:
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
scheduler:
image: mtsrus/syncmaster-scheduler:${TAG:-develop}
restart: unless-stopped
build:
dockerfile: docker/Dockerfile.scheduler
context: .
target: prod
env_file: .env.docker
depends_on:
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
volumes:
postgres_data:
rabbitmq_data: