chore(deploy): Docker production config, nginx gzip/cache, deploy docs

- docker-compose.yml: restart always, env_file, named volume, start_period
- frontend/nginx.conf: gzip compression, cache headers for assets, no-cache for SW
- Makefile: add prod-down and prod-logs targets
- docs/DEPLOY.md: Dokploy + Cloudflare Tunnel deploy instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 17:20:36 +02:00
parent 6f82c56995
commit a16d01a669
4 changed files with 168 additions and 6 deletions

View File

@@ -1,25 +1,33 @@
services:
backend:
build: ./backend
restart: unless-stopped
restart: always
env_file: .env
volumes:
- ./backend/data:/app/data
- backend-data:/app/data
environment:
- DATABASE_URL=sqlite+aiosqlite:///./data/roaauto.db
- SECRET_KEY=${SECRET_KEY}
- SMSAPI_TOKEN=${SMSAPI_TOKEN:-}
- CORS_ORIGINS=https://roaauto.romfast.ro
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/api/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
frontend:
build: ./frontend
restart: unless-stopped
restart: always
ports:
- "80:80"
depends_on:
backend:
condition: service_healthy
volumes:
backend-data:
driver: local
driver_opts:
type: none
o: bind
device: ./backend/data