-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
62 lines (57 loc) · 1.3 KB
/
compose.yaml
File metadata and controls
62 lines (57 loc) · 1.3 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
name: taxi-zone
services:
dispatch-service:
user: root
env_file:
- .env
build:
context: ./
dockerfile: Dockerfile.dispatcher
ports:
- "8000:8000"
command: bash -c "
uvicorn dispatch_service.main:app
--host 0.0.0.0 --port 8000
--lifespan=on --use-colors --loop uvloop --http httptools
--reload --log-level debug
"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./dispatch-service:/taxi/dispatch-service
- ./alembic:/taxi/alembic
depends_on:
- db
worker-service:
build:
context: ./
dockerfile: Dockerfile.worker
depends_on:
- dispatch-service
command: python3 main.py
deploy:
replicas: 20
db:
build:
context: ./db
dockerfile: Dockerfile
volumes:
- taxi_data:/var/lib/postgresql/data
env_file:
- .env
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
healthcheck:
test:
[
"CMD-SHELL", "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER"
]
interval: 5s
timeout: 5s
retries: 5
volumes:
dispatch-data: {}
taxi_data: {}