- 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>
2.1 KiB
2.1 KiB
ROA AUTO - Deploy Guide
Prerequisites
- Docker & Docker Compose installed
- Domain configured (e.g., roaauto.romfast.ro)
- Cloudflare Tunnel configured (or reverse proxy)
Production Deploy on Dokploy
1. Clone and configure
git clone <repo-url> roaauto
cd roaauto
cp .env.example .env
Edit .env with production values:
SECRET_KEY=<generate-a-strong-secret>
DATABASE_URL=sqlite+aiosqlite:///./data/roaauto.db
SMSAPI_TOKEN=<your-smsapi-token>
CORS_ORIGINS=https://roaauto.romfast.ro
Generate a secret key:
python3 -c "import secrets; print(secrets.token_urlsafe(64))"
2. Build and start
make prod-build
make prod-up
Verify:
curl http://localhost/api/health
# {"status":"ok"}
3. Run initial migration
docker compose exec backend alembic upgrade head
4. Seed catalog data (first deploy only)
docker compose exec backend python -m app.db.seed
Cloudflare Tunnel Setup
- Install
cloudflaredon the Proxmox host - Create a tunnel:
cloudflared tunnel create roaauto - Configure the tunnel to route
roaauto.romfast.rotohttp://localhost:80 - Run as a service:
cloudflared service install
The tunnel provides HTTPS termination - nginx listens on port 80 internally.
Dokploy Configuration
If using Dokploy instead of manual Docker:
- Create a new project in Dokploy
- Set source to your Git repository
- Set compose file to
docker-compose.yml - Add environment variables from
.env.example - Set the domain to
roaauto.romfast.ro - Deploy
Maintenance
Logs
make prod-logs
Database backup
make backup
Update deployment
git pull
make prod-build
make prod-up
Rollback
git checkout <previous-commit>
make prod-build
make prod-up
Architecture
Internet → Cloudflare Tunnel → nginx (:80)
├── / → SPA (static files)
└── /api → backend (:8000)
backend: Python 3.12 + FastAPI + SQLite (file-based)
frontend: Vue 3 SPA served by nginx
data: ./backend/data/ (bind mount, persisted)