Add deployment configs and DEPLOYMENT.md so the repo can be launched as a website#1
Draft
cphlabspace wants to merge 5 commits into
Draft
Add deployment configs and DEPLOYMENT.md so the repo can be launched as a website#1cphlabspace wants to merge 5 commits into
cphlabspace wants to merge 5 commits into
Conversation
Multi-stage Debian-slim image that builds the TypeScript backend in a builder stage and ships a minimal runtime stage containing the compiled output plus LibreOffice, fonts, and tini. Runs as a non-root user and exposes a /health-based HEALTHCHECK so platforms like Fly.io and any container orchestrator can route traffic correctly out of the box. Co-authored-by: cphlabspace <cphlabspace@users.noreply.github.com>
Adds a multi-stage Dockerfile that builds the Next.js app in standalone mode and runs the produced server.js as a non-root user on port 3000. NEXT_PUBLIC_* values are accepted as build args so they get baked into the static bundle. next.config.ts now honors NEXT_OUTPUT_MODE so the standalone build is opt-in. `next dev`, `next start`, and the OpenNext Cloudflare path are unaffected when the variable is unset. Co-authored-by: cphlabspace <cphlabspace@users.noreply.github.com>
Two parallel jobs run `npm run build` for each app on Node 20. The frontend job also runs lint as a non-blocking check (the repo carries a backlog of pre-existing warnings) and supplies dummy NEXT_PUBLIC_* values so the Next build can complete without real Supabase credentials. Co-authored-by: cphlabspace <cphlabspace@users.noreply.github.com>
End-to-end guide covering external service setup (Supabase, R2, model providers, Resend), every required env var, and concrete deployment steps for Cloudflare Workers, Vercel, Fly.io, Render, Railway, and plain Docker, plus a wiring-and-troubleshooting section. Co-authored-by: cphlabspace <cphlabspace@users.noreply.github.com>
The package.json already wires `npm run deploy` through @opennextjs/cloudflare, but the Wrangler config it depends on was missing. This file points Wrangler at the OpenNext build output (.open-next/worker.js plus the assets directory), turns on nodejs_compat, and enables observability. Co-authored-by: cphlabspace <cphlabspace@users.noreply.github.com>
This was referenced May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The repo already builds locally, but to actually launch it as a public website a few pieces were missing: a Dockerfile for the backend (with LibreOffice), a Dockerfile for the frontend, the Cloudflare
wranglerconfig thatnpm run deployrelies on, a self-hosteddocker-compose.yml, CI to verify builds, and an end-to-end deployment walkthrough.This PR adds all of that without changing application code.
Changes
backend/Dockerfile+backend/.dockerignore— multi-stage Debian-slim image, LibreOffice + fonts baked in, non-root user,/healthhealthcheck, tini as init.frontend/Dockerfile+frontend/.dockerignore— multi-stage build using Next.js standalone output, non-root user,NEXT_PUBLIC_*accepted as build args.frontend/next.config.ts— opt-inoutput: "standalone"controlled byNEXT_OUTPUT_MODE, so the Docker build path producesserver.jswhilenext dev/next start/the OpenNext Cloudflare path stay unaffected.frontend/wrangler.jsonc— Cloudflare Workers config matching the OpenNext output, withnodejs_compatenabled. Required fornpm run deployto actually work.docker-compose.ymlat repo root — brings the whole stack up locally or on any Docker host. Frontend waits for the backend healthcheck..github/workflows/ci.yml— parallel backend and frontendnpm run buildon every push/PR. Lint runs as a non-blocking check because the repo has a backlog of pre-existing warnings.DEPLOYMENT.md— end-to-end guide covering Supabase / R2 / model-provider setup, every required env var, and concrete deploy steps for Cloudflare Workers, Vercel, Fly.io, Render, Railway, and plain Docker, plus wiring and troubleshooting.README.md— short "Deployment" section linking to the new guide and showing the one-linerdocker compose up --buildpath.Why
The deployment story was implicit. With these additions a maintainer (or anyone forking) can pick a host, follow
DEPLOYMENT.md, and have a working site without reverse-engineering env vars or build commands. The frontend Cloudflare deploy in particular was unusable before this PR becausewrangler.jsoncwas missing.Testing
Locally on Node 20:
Both builds match what the new CI workflow runs. Docker images were not built in this environment (no Docker daemon available), but the Dockerfiles follow the same
npm ci+npm run buildpaths that pass above, plus the standard Next.js standalone runtime layout.Notes for the reviewer
outputfield innext.config.ts, gated on an env var that is unset by default.wrangler.jsoncuses the standard OpenNext output paths (.open-next/worker.js,.open-next/assets). If your account already has a Worker namedmike, change thenamefield before deploying.continue-on-error: true. Flipping it to blocking is a separate cleanup PR.