Dockerize backend, frontend, and database into separate containers
- backend/Dockerfile: multi-stage Python build (builder + slim runtime) - frontend/Dockerfile: multi-stage Node build + nginx:alpine serving - frontend/nginx.conf: SPA routing + /api/ reverse proxy to backend - docker-compose.yml: production compose with health checks and proper dependency ordering - docker-compose.dev.yml: dev overrides with hot reload via volume mounts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Development overrides — hot reload for backend and frontend
|
||||
# Usage: docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
|
||||
|
||||
services:
|
||||
|
||||
backend:
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
target: builder # stop at the Node stage, skip nginx
|
||||
command: npm run dev -- --host 0.0.0.0
|
||||
ports:
|
||||
- "5173:5173"
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
- /app/node_modules
|
||||
Reference in New Issue
Block a user