Skip to content

Deployment

Servet Arslan edited this page Jun 5, 2026 · 1 revision

Deployment

Infrastructure

Service Provider Region
API Server GCP Cloud Run europe-west1
Worker GCP Cloud Run europe-west1
Database Neon PostgreSQL eu-central-1
Cache Upstash Redis eu-central-1
Dashboard Vercel Global (Edge)
DNS/CDN Cloudflare Global

GCP Cloud Build

Builds are triggered by GitHub push to main. Configuration: cloudbuild.yaml

# Build steps:
1. cargo check --workspace     # Rust compilation check
2. Run database migrations     # Apply pending SQL migrations
3. Build API Docker image      # rust:1.95-bookworm
4. Build Worker Docker image   # rust:1.95-bookworm
5. Push images to Artifact Registry
6. Deploy API to Cloud Run     # min-instances=1, max-instances=3
7. Deploy Worker to Cloud Run  # min-instances=0, max-instances=4

API Cloud Run Config

  • Memory: 1Gi
  • CPU: 1
  • Min instances: 1 (no cold start)
  • Max instances: 3
  • Startup probe: /health on port 3000

Worker Cloud Run Config

  • Memory: 1Gi
  • CPU: 1
  • Min instances: 0
  • Max instances: 4
  • No startup probe (no HTTP server)

Vercel Dashboard

  • Auto-deploys on GitHub push to main
  • Preview deployments for PRs
  • Production URL: hooksniff.vercel.app
  • Custom domain support

Environment Variables

All secrets stored in GCP Secret Manager and Vercel Environment Variables.

Key secrets:

  • DATABASE_URL (Neon PostgreSQL)
  • REDIS_URL (Upstash Redis)
  • JWT_SECRET
  • HMAC_SECRET
  • POLAR_ACCESS_TOKEN
  • RESEND_API_KEY
  • OTEL_EXPORTER_OTLP_HEADERS (Sentry)

Disaster Recovery

See DR_PLAN.md in the repository.

Clone this wiki locally