Deploy & CI/CD

Docker

The repo ships a root Dockerfile that builds Next.js standalone (one process: pages + Hono at /api). CI pushes to GHCR — see doc/CI_CD_PRODUCTION.md. For local Postgres, use a dev DB container so onboarding does not depend on cloud Neon.

GitHub Actions pattern

A solid default: push to develop Staging environment; push to master Production.

  • Map each GitHub Environment to its own secrets/vars (DB URL, auth, Stripe mode, etc.).
  • Push images to GHCR with clear tags (latest / version for prod, staging tag for preview).
  • After a successful push, optionally call Coolify deploy webhooks (GET + bearer token) — separate webhook URL per environment.

Example webhook step (conceptual)

curl -sf -X GET "$COOLIFY_WEBHOOK" \
  -H "Authorization: Bearer $COOLIFY_TOKEN"

Checklist before first prod deploy

  • Migrations applied to production database.
  • Stripe live webhook endpoint + secret.
  • NEXT_PUBLIC_APP_URL (or equivalent) matches public URL.
  • HTTPS everywhere; CORS and auth URLs updated for prod domain.
Branch protectionRequire PR review on master; let develop auto-build staging so QA always matches the latest integration branch.