-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
44 lines (41 loc) · 1019 Bytes
/
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
services:
db:
image: postgres:15
environment:
# TODO: Should not be hardcoded on the code
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 5s
retries: 5
start_period: 5s
timeout: 10s
api:
build:
context: backend/
dockerfile: Dockerfile # Your FastAPI Dockerfile path
environment:
# TODO: Should not be hardcoded on the code
- DATABASE_URL=postgresql://myuser:mypassword@db:5432/mydatabase
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
restart: true
frontend:
build:
context: frontend/
dockerfile: Dockerfile # Your FastAPI Dockerfile path
ports:
- "3000:3000"
depends_on:
- db
volumes:
postgres_data: