chore(devops): docker-compose dev + prod, Dockerfiles, nginx, Makefile
- backend/Dockerfile: Python 3.12 slim, non-root user, WeasyPrint system deps - backend/Dockerfile.dev: dev variant with hot-reload support - frontend/Dockerfile: Node 20 alpine build + nginx:alpine serve - frontend/nginx.conf: SPA routing + /api proxy to backend:8000 - docker-compose.yml: production with healthcheck - docker-compose.dev.yml: dev with volume mounts and hot-reload - Makefile: dev, build, up, down, logs, migrate, test, shell, prod targets - .dockerignore for backend and frontend Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
26
docker-compose.dev.yml
Normal file
26
docker-compose.dev.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile.dev
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- ./backend/data:/app/data
|
||||
environment:
|
||||
- DATABASE_URL=sqlite+aiosqlite:///./data/roaauto.db
|
||||
- SECRET_KEY=dev-secret-key-change-in-prod
|
||||
- CORS_ORIGINS=http://localhost:5173
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
||||
|
||||
frontend:
|
||||
image: node:20-alpine
|
||||
ports:
|
||||
- "5173:5173"
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
working_dir: /app
|
||||
environment:
|
||||
- VITE_API_URL=http://localhost:8000/api
|
||||
command: sh -c "npm install && npm run dev -- --host"
|
||||
Reference in New Issue
Block a user