Skip to content

Prepare Docker Compose VPS deployment#25

Open
Spbd1 wants to merge 1 commit into
codex/improve-admin-dashboard-analyticsfrom
codex/prepare-app-for-vps-deployment-with-docker-compose
Open

Prepare Docker Compose VPS deployment#25
Spbd1 wants to merge 1 commit into
codex/improve-admin-dashboard-analyticsfrom
codex/prepare-app-for-vps-deployment-with-docker-compose

Conversation

@Spbd1

@Spbd1 Spbd1 commented May 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Fix Node.js version mismatch between package.json (Node 22) and the Docker image and make the container build reproducible and production-safe.
  • Ensure the Compose service exposes all documented deployment environment variables (Google Sheets, submission flags, admin/export secrets, rate/body limits, consent/schema) so the VPS environment can be configured from .env.
  • Keep Postgres private inside the Docker network and bind the app to localhost so a reverse proxy (Caddy/Nginx) can handle public HTTPS.

Description

  • Update Dockerfile to use node:22-alpine, install dependencies reproducibly with npm ci when package-lock.json exists, run npm run db:generate before npm run build, add a build-time arg/ENV for NEXT_PUBLIC_ENABLE_SERVER_SUBMISSION, and set runtime production envs (NODE_ENV=production, NEXT_TELEMETRY_DISABLED=1, HOSTNAME=0.0.0.0, PORT=3000).
  • Update docker-compose.yml to pass the documented env vars (GOOGLE_SHEETS_WEBHOOK_URL, GOOGLE_SHEETS_WEBHOOK_SECRET, APP_BASE_URL, ENABLE_SERVER_SUBMISSION, NEXT_PUBLIC_ENABLE_SERVER_SUBMISSION, ADMIN_EXPORT_TOKEN, SUBMISSION_RATE_LIMIT_WINDOW_MS, SUBMISSION_RATE_LIMIT_MAX, MAX_SUBMISSION_BODY_BYTES, CONSENT_VERSION, SCHEMA_VERSION), add a build-time arg for NEXT_PUBLIC_ENABLE_SERVER_SUBMISSION, remove the obsolete ADMIN_DASHBOARD_PASSWORD entry, and bind the app to 127.0.0.1:3000 while keeping Postgres private (no host ports) with clarifying comments for VPS usage.
  • Update .dockerignore to exclude build/context noise and local Docker artifacts (.docker/, docker-data/, docker-compose.override.yml, *.tar) in addition to existing ignores like node_modules, .next, .env, exports, .git, and logs.
  • Files changed: Dockerfile, docker-compose.yml, .dockerignore.

Testing

  • Ran npm run typecheck and it completed successfully.
  • Ran npm run lint and it completed successfully with an existing React hook dependency warning reported (did not block the run).
  • Ran npm run build and the Next.js production build completed successfully (static pages generated; build-time flag note applies).
  • Attempted docker compose build and docker compose config but they could not be executed in this environment because the Docker CLI is not available (commands failed with docker: command not found).

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