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:
curo1305
2026-04-12 15:22:04 +02:00
parent 85f76c70de
commit 114df7162f
7 changed files with 157 additions and 32 deletions
+20
View File
@@ -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