demo-dockerwSubmodules/docker-compose.yml

43 lines
876 B
YAML
Raw Permalink Normal View History

2025-01-17 00:59:27 +01:00
services:
2025-01-17 01:04:17 +01:00
demo-db:
2025-01-17 01:38:05 +01:00
container_name: db
2025-01-17 00:59:27 +01:00
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=todo_db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
backend:
build:
2025-01-17 01:04:17 +01:00
context: ./backend/
2025-01-17 00:59:27 +01:00
command: sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
environment:
- DB_NAME=todo_db
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_HOST=db
- DB_PORT=5432
- DEBUG=1
depends_on:
2025-01-17 01:04:17 +01:00
- demo-db
2025-01-17 00:59:27 +01:00
frontend:
build:
2025-01-17 01:04:17 +01:00
context: ./frontend
2025-01-17 00:59:27 +01:00
command: sh -c "npm run dev -- --host 0.0.0.0"
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:8000/api
depends_on:
- backend
volumes:
postgres_data: