-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
57 lines (54 loc) · 1.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
57 lines (54 loc) · 1.22 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
services:
migrate:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./alembic:/htb/alembic
- ./alembic.ini:/htb/alembic.ini
- ./app:/htb/app
command: uv run alembic upgrade head
env_file:
- .env
depends_on:
db:
condition: service_healthy
server:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./alembic:/htb/alembic
- ./alembic.ini:/htb/alembic.ini
- ./app:/htb/app
- ./images:/htb/images
- ./media:/htb/media
- ./templates:/htb/templates
command: uv run fastapi dev --host 0.0.0.0 --port 8000
env_file:
- .env
ports:
- 8000:8000
depends_on:
migrate:
condition: service_completed_successfully
db:
image: postgres:17
command: postgres -c max_connections=200
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
volumes:
- db:/var/lib/postgresql/data/
# - ./dump.sql:/docker-entrypoint-initdb.d/dump.sql
env_file:
- .env
ports:
- 5433:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 1s
timeout: 3s
retries: 30
volumes:
db: