Deployment Overview
How code reaches production -- the deploy pipeline, environment strategy, rollback procedures, and post-deploy verification.
Trovella uses a merge-to-main deployment model. Merging a pull request to main triggers the full CI/CD pipeline, which builds a Docker image, optionally runs database migrations, and deploys to a single Compute Engine VM via SSH. There is no manual deploy step.
How It Works
- A PR is merged to
main - The
qualityCI job validates the code (lint, typecheck, test, build) - If database schema files changed,
migrate-prodapplies migrations to Cloud SQL build-pushbuilds a Docker image and pushes it to Artifact Registrydeploy-prodSSHs into the production VM, syncs secrets, pulls the image, and restarts containers- The health endpoint confirms the deploy succeeded
Total time from merge to live: 5--10 minutes.
Production Stack
The production VM runs five Docker containers via docker-compose.prod.yml:
| Container | Image | Role |
|---|---|---|
caddy | caddy:2-alpine | Reverse proxy, automatic TLS (Let's Encrypt), HTTP/3 |
web | trovella/web:latest | Next.js standalone app (port 3000) |
cloud-sql-proxy | Cloud SQL Auth Proxy 2.21 | Tunnels database connections to Cloud SQL |
typesense | typesense/typesense:27.1 | Search engine (port 8108) |
inngest | inngest/inngest:latest | Background job orchestrator (port 8288) |
Caddy is the only container with external ports (80, 443). All other services communicate on the Docker network.
Pages in This Topic
- Deploy Pipeline -- step-by-step breakdown of what happens when code is merged to
main - Environment Promotion -- how code moves from local to CI to production, plus the future staging plan
- Rollback Procedures -- three options for reverting a bad deploy, from fastest to most thorough
- Post-Deploy Verification -- health checks, log inspection, and monitoring alerts
- Failure Recovery -- diagnosis and recovery for common deploy failures
Cross-Domain References
- Delivery -- Pipeline -- the full CI pipeline structure (quality, docs, build jobs)
- Data & Storage -- CI Deployment -- how the
migrate-prodjob works - Infrastructure -- Compute -- VM provisioning, machine types, and Docker runtime
- Infrastructure -- Secrets -- GCP Secret Manager and the secret sync script