-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
39 lines (37 loc) · 951 Bytes
/
docker-compose.yml
File metadata and controls
39 lines (37 loc) · 951 Bytes
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
services:
db:
image: postgres:15
restart: always
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydb
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data # <- this makes it persistent
backend:
build: ./backend
depends_on:
- db
container_name: fastapi-backend
ports:
- "8000:8000"
environment:
DATABASE_URL: postgres://myuser:mypassword@db:5432/mydb
volumes:
- ./backend:/app
restart: unless-stopped
frontend:
build: ./frontend
container_name: react-frontend
ports:
- "5173:5173"
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
restart: unless-stopped
volumes:
db_data: