52 lines
1.5 KiB
YAML
52 lines
1.5 KiB
YAML
# =============================================================================
|
|
# Development overlay: hot reload for both halves of the stack.
|
|
#
|
|
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
|
|
# → SPA (Vite dev server) http://localhost:5173
|
|
# → API http://localhost:8000/api/docs/
|
|
#
|
|
# Sources are bind-mounted, so an edit is live without rebuilding an image.
|
|
# =============================================================================
|
|
|
|
services:
|
|
backend:
|
|
build:
|
|
# The dev stage adds dev.txt (django-extensions, pytest, ...) on top of
|
|
# the runtime image; config.settings.dev cannot be imported without it.
|
|
target: dev
|
|
command:
|
|
- python
|
|
- manage.py
|
|
- runserver
|
|
- 0.0.0.0:8000
|
|
environment:
|
|
DJANGO_SETTINGS_MODULE: config.settings.dev
|
|
DJANGO_DEBUG: "true"
|
|
LOG_LEVEL: DEBUG
|
|
volumes:
|
|
- ./backend:/app
|
|
- ./data:/data:ro
|
|
ports:
|
|
- "127.0.0.1:${BACKEND_PORT:-8000}:8000"
|
|
# runserver reloads on save; gunicorn's healthcheck curl is still valid.
|
|
user: "0:0"
|
|
|
|
frontend:
|
|
image: node:22-alpine
|
|
build: !reset null
|
|
working_dir: /app
|
|
command: sh -c "npm install --no-audit --no-fund && npm run dev -- --host 0.0.0.0"
|
|
environment:
|
|
VITE_PROXY_TARGET: http://backend:8000
|
|
volumes:
|
|
- ./frontend:/app
|
|
- frontend-node-modules:/app/node_modules
|
|
ports:
|
|
- "5173:5173"
|
|
read_only: false
|
|
tmpfs: !reset []
|
|
networks: [frontend-net]
|
|
|
|
volumes:
|
|
frontend-node-modules:
|