-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
114 lines (106 loc) · 2.59 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
version: "3"
services:
backend:
image: backend
container_name: backend
build: .
user: appuser
ports:
- '8000:8000'
volumes:
- ./service:/app
depends_on:
database:
condition: service_healthy
cache:
condition: service_healthy
command: bash -c 'alembic upgrade head && uvicorn app:app --reload --host 0.0.0.0'
database:
image: postgres:15-alpine
hostname: $${POSTGRES_HOST}
container_name: database
environment:
- POSTGRES_DB=database
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_HOST_AUTH_METHOD=trust
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 1s
timeout: 3s
retries: 5
ports:
- '8001:5432'
volumes:
- database:/var/lib/postgresql/data
cache:
image: redis:7-alpine
hostname: $${REDIS_HOST}
container_name: cache
environment:
- REDIS_HOST=cache
healthcheck:
test: [ "CMD", "redis-cli","ping" ]
interval: 1s
timeout: 3s
retries: 5
ports:
- '8002:6379'
worker:
image: worker
hostname: worker
container_name: worker
build: .
user: appuser
ports:
- '9191:9191'
volumes:
- ./service:/app
depends_on:
database:
condition: service_healthy
cache:
condition: service_healthy
# Don't use --watch for production setup!
command: 'dramatiq --watch . --processes 4 core.workers'
scheduler:
image: scheduler
hostname: scheduler
container_name: scheduler
build: .
user: appuser
volumes:
- ./service:/app
depends_on:
cache:
condition: service_healthy
command: 'periodiq core.workers'
prometheus:
image: prom/prometheus:v2.41.0
hostname: prometheus
container_name: prometheus
ports:
- '9090:9090'
volumes:
- prometheus:/prometheus
- ./configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana-oss:9.3.2
hostname: grafana
container_name: grafana
environment:
- GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH=/etc/grafana/provisioning/dashboards/dashboard.json
ports:
- '3000:3000'
volumes:
- grafana:/var/lib/grafana
- ./configs/grafana/dashboards/:/etc/grafana/provisioning/dashboards/
- ./configs/grafana/provisioning/:/etc/grafana/provisioning/datasources/
depends_on:
- prometheus
volumes:
database:
prometheus:
grafana: