Skip to content

CI/CD pipeline

The repo does not have a full automated CI/CD pipeline today. Deployments are still manual.

This page describes the flow the repo actually uses now.

Current workflow

  1. Build the image with Docker Compose.
  2. Run Prisma generation inside the image build.
  3. Build the Next.js app in standalone mode.
  4. Start the app and Redis containers with Docker Compose.

Build flow

Dockerfile.prod has four jobs:

  • base: enables pnpm
  • installer: installs full dependencies for the build
  • prod-installer: installs production dependencies for the runtime image
  • builder: runs pnpm exec prisma generate and pnpm run build
  • runner: copies the standalone app output and starts node server.js

Important detail: the production Docker build no longer builds a separate docs site.

Staging commands

task 01-build-staging
task 02-start-staging
task 03-stop-staging

Direct compose equivalents:

docker compose -f docker-compose.staging.yml build --no-cache
docker compose -f docker-compose.staging.yml up -d
docker compose -f docker-compose.staging.yml down

Production commands

task 04-build-production
task 05-start-production
task 06-stop-production

Direct compose equivalents:

docker compose -f docker-compose.prod.yml build --no-cache
docker compose -f docker-compose.prod.yml up -d
docker compose -f docker-compose.prod.yml down
docker compose -f docker-compose.prod.yml logs -f

Release checklist

Before production deploy:

  • Run pnpm lint
  • Run pnpm test
  • Run pnpm build
  • Confirm the right .env.production values are in place
  • Back up the production database if the release is risky
  • Run pnpm db:deploy-prod when schema changes are included

Rollback

If a deploy goes wrong:

  1. Stop the current production containers.
  2. Restore the previous image or previous checkout.
  3. Start production again.
  4. If the release included a bad migration, restore the database from backup.

Useful commands:

task 06-stop-production
docker compose -f docker-compose.prod.yml up -d

What is not in place yet

These pieces are not wired up in the repo today:

  • automatic deploys on push
  • container registry publishing
  • approval gates
  • automated rollback
  • end-to-end deployment automation

If those are added later, update this page to describe the real pipeline rather than a proposed one.