Skip to content

Prepare VPS deployment: Dockerfile, docker-compose.prod, health endpoint, docs, Makefile, and Nginx example#11

Open
Spbd1 wants to merge 1 commit into
codex/harden-parcel-society-mvp-for-deploymentfrom
codex/prepare-parcel-society-for-vps-deployment
Open

Prepare VPS deployment: Dockerfile, docker-compose.prod, health endpoint, docs, Makefile, and Nginx example#11
Spbd1 wants to merge 1 commit into
codex/harden-parcel-society-mvp-for-deploymentfrom
codex/prepare-parcel-society-for-vps-deployment

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 10, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prepare the project to run in a VPS production environment using Docker Compose with a containerized PostgreSQL and a standalone Next.js production image.
  • Ensure the web service is production-ready with a non-root runtime, healthcheck, environment-driven secrets, and a documented deployment workflow.
  • Provide operational tooling and guidance for migrations, backups, admin bootstrap, and optional Nginx reverse proxy with HTTPS-ready configuration.

Description

  • Add a production-ready web Dockerfile that builds the Next.js standalone output, includes a tools target for DB tasks, runs as a non-root user, exposes internal port 3000, and includes a container HEALTHCHECK that calls GET /api/health (apps/web/Dockerfile).
  • Add docker-compose.prod.yml with services postgres, web, a one-off migrate tools service, and an optional nginx profile, including a persistent postgres volume, env-file support, healthchecks, and localhost-only web port binding for reverse proxying.
  • Implement GET /api/health at apps/web/app/api/health/route.ts which checks DB connectivity using prisma.$queryRaw and returns { ok, database, timestamp }, responding 503 if the DB is unreachable.
  • Add docs/deployment.md with VPS-focused step-by-step guidance covering server requirements, Docker installation, cloning, .env setup, migrations, creating the first admin, running containers, Nginx/HTTPS guidance, updating, and backup/restore and security notes.
  • Add operational helpers: Makefile with dev, prod-up, prod-down, logs, migrate, seed, backup, and restore targets, plus a .dockerignore to keep secrets and local artifacts out of builds.
  • Add an example host Nginx config at deploy/nginx/parcel-society.conf.example that reverse-proxies https://your-domain.com to http://127.0.0.1:3000 and an updated .env.example showing production env variables.
  • Add db:deploy script to packages/db/package.json which uses prisma db push for schema deployment in the current repo state.

Testing

  • git diff --check was run and reported no whitespace/errors in diffs (success).
  • Basic JSON validation of package.json and packages/db/package.json was performed with python3 and succeeded (success).
  • pnpm install was attempted but failed due to a 403 Forbidden when fetching @tailwindcss/postcss from the configured registry, preventing installation of node_modules (failed).
  • Typechecks and build-related checks (pnpm --filter @parcel-society/web typecheck, pnpm --filter @parcel-society/db typecheck) could not complete because dependencies were not installed after the registry failure (blocked).
  • docker compose -f docker-compose.prod.yml config could not be run in this environment because Docker is not available (not executed).

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant