-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
61 lines (58 loc) · 1.32 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
services:
api:
container_name: api
build:
context: .
dockerfile: Dockerfile
target: dev
command: python -m src
volumes:
- ./src:/app/src/:ro
- ./config_dist:/app/config_dist:ro
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
nats:
condition: service_started
environment:
- BUBER_DINNER_CONFIG_PATH=config_dist/config.prod.toml
nats:
container_name: nats
image: nats:alpine3.19
command: nats-server --user ${NATS_USER:?err} --pass ${NATS_PASSWORD:?err}
ports:
- 14222:4222
env_file:
- ./.env
db:
container_name: db
image: postgres:16
restart: on-failure
ports:
- 15432:5432
volumes:
- ./db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER"]
interval: 5s
timeout: 20s
retries: 5
env_file:
- ./.env
migrations:
container_name: migrations
build:
context: .
dockerfile: Dockerfile
target: migrations
volumes:
- ./config_dist:/app/config_dist:ro
depends_on:
db:
condition: service_healthy
command: alembic upgrade head
environment:
- DB_HOST=db
- BUBER_DINNER_CONFIG_PATH=config_dist/config.prod.toml