feat(docker): add Docker Compose deployment for Dokploy
- backend/Dockerfile: Python 3.12-slim, uvicorn on port 8000 - frontend/Dockerfile: multi-stage Node build + nginx:alpine serve - frontend/nginx.conf: proxy /api to backend, SPA routing for Vue Router - docker-compose.yml: backend+frontend services with Traefik labels - fix(cors): use settings.frontend_url instead of hardcoded localhost Fixes Nixpacks detection failure (requirements.txt/package.json not at root). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
42
docker-compose.yml
Normal file
42
docker-compose.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
backend:
|
||||
build: ./backend
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- SECRET_KEY=${SECRET_KEY:-change-me-in-production}
|
||||
- DATABASE_URL=sqlite:////data/space_booking.db
|
||||
- FRONTEND_URL=${FRONTEND_URL:-http://localhost}
|
||||
- SMTP_HOST=${SMTP_HOST:-localhost}
|
||||
- SMTP_PORT=${SMTP_PORT:-1025}
|
||||
- SMTP_ENABLED=${SMTP_ENABLED:-false}
|
||||
volumes:
|
||||
- backend_data:/data
|
||||
- uploads_data:/app/uploads
|
||||
networks:
|
||||
- internal
|
||||
|
||||
frontend:
|
||||
build: ./frontend
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- internal
|
||||
- dokploy-network
|
||||
depends_on:
|
||||
- backend
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.space-booking.rule=Host(`${DOMAIN:-space-booking.roa.romfast.ro}`)"
|
||||
- "traefik.http.routers.space-booking.tls=true"
|
||||
- "traefik.http.services.space-booking.loadbalancer.server.port=80"
|
||||
|
||||
volumes:
|
||||
backend_data:
|
||||
uploads_data:
|
||||
|
||||
networks:
|
||||
internal:
|
||||
driver: bridge
|
||||
dokploy-network:
|
||||
external: true
|
||||
Reference in New Issue
Block a user