-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
91 lines (86 loc) · 1.98 KB
/
docker-compose.yaml
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
version: '3.8'
name: faststream-template
services:
http:
build: .
env_file:
- .env
environment:
POSTGRES_HOST: "postgres"
RABBIT_HOST: "rabbit"
REDIS_HOST: "redis"
entrypoint: >
sh -c "
poetry run alembic upgrade head || (echo 'Migration failed' && exit 1);
poetry run uvicorn app:http --reload --host 0.0.0.0
"
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
rabbit:
condition: service_healthy
redis:
condition: service_healthy
amqp:
build: .
env_file:
- .env
environment:
POSTGRES_HOST: "postgres"
RABBIT_HOST: "rabbit"
REDIS_HOST: "redis"
entrypoint: sh -c "poetry run faststream run app:amqp --reload"
depends_on:
http:
condition: service_started
scheduler:
build: .
env_file:
- .env
environment:
POSTGRES_HOST: "postgres"
RABBIT_HOST: "rabbit"
REDIS_HOST: "redis"
entrypoint: sh -c "poetry run taskiq scheduler app:scheduler"
depends_on:
amqp:
condition: service_started
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
ports:
- "5432:5432"
healthcheck:
test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB -h localhost
interval: 10s
timeout: 30s
retries: 5
start_period: 80s
rabbit:
image: rabbitmq:3.13-management-alpine
environment:
RABBITMQ_DEFAULT_USER: $RABBIT_USERNAME
RABBITMQ_DEFAULT_PASS: $RABBIT_PASSWORD
ports:
- "5672:5672"
healthcheck:
test: rabbitmqctl ping
interval: 10s
timeout: 5s
retries: 3
redis:
image: redis:7-alpine
environment:
ALLOW_EMPTY_PASSWORD: "yes"
ports:
- "6379:6379"
healthcheck:
test: redis-cli ping
interval: 10s
timeout: 30s
retries: 5