# Deployment

Use independent images for web, API and worker. Run Prisma migrations as a
single pre-deploy job. Provide managed MySQL 8 and Redis with TLS, backups and
network allowlists. Scale API instances behind sticky or WebSocket-aware load
balancing and configure the Socket.IO Redis adapter before multi-instance use.
Terminate HTTPS at the ingress and keep application secrets in a secret manager.

The included VPS flow uses Caddy and `docker-compose.production.yml`. Run
`scripts/bootstrap-vps.sh` once, store production configuration at
`/opt/fivem-dashboard/shared/.env`, then push `main` to the VPS bare Git remote.
The receive hook builds, migrates and starts the new revision. Failed builds stop
before replacing running containers.
