-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (45 loc) · 1.15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
47 lines (45 loc) · 1.15 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
services:
tz-postgres:
image: postgres:17
container_name: tz-postgres
command: postgres -c 'max_connections=2000' -c 'jit=off'
ports:
- "5499:5432"
environment:
POSTGRES_USER: tz_user
POSTGRES_PASSWORD: tz_password
POSTGRES_DB: tz_db
volumes:
- tz-pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tz_user"]
interval: 5s
timeout: 5s
retries: 10
tz-app:
build: .
container_name: tz-app
ports:
- "8099:8000"
environment:
POSTGRES_HOST: tz-postgres
POSTGRES_PORT: 5432
POSTGRES_USER: tz_user
POSTGRES_PASSWORD: tz_password
POSTGRES_DB: tz_db
volumes:
- ./src:/app/src
depends_on:
tz-postgres:
condition: service_healthy
command: >
sh -c "uv run alembic upgrade head && uv run uvicorn src.main:app --host 0.0.0.0 --port 8000"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/docs')"]
interval: 5s
timeout: 5s
retries: 12
start_period: 15s
volumes:
tz-pgdata:
driver: local