Prepare VPS deployment: Dockerfile, docker-compose.prod, health endpoint, docs, Makefile, and Nginx example#11
Open
Spbd1 wants to merge 1 commit into
Conversation
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.
Motivation
Description
Dockerfilethat builds the Next.js standalone output, includes atoolstarget for DB tasks, runs as a non-root user, exposes internal port3000, and includes a containerHEALTHCHECKthat callsGET /api/health(apps/web/Dockerfile).docker-compose.prod.ymlwith servicespostgres,web, a one-offmigratetools service, and an optionalnginxprofile, including a persistentpostgresvolume, env-file support, healthchecks, and localhost-only web port binding for reverse proxying.GET /api/healthatapps/web/app/api/health/route.tswhich checks DB connectivity usingprisma.$queryRawand returns{ ok, database, timestamp }, responding503if the DB is unreachable.docs/deployment.mdwith VPS-focused step-by-step guidance covering server requirements, Docker installation, cloning,.envsetup, migrations, creating the first admin, running containers, Nginx/HTTPS guidance, updating, and backup/restore and security notes.Makefilewithdev,prod-up,prod-down,logs,migrate,seed,backup, andrestoretargets, plus a.dockerignoreto keep secrets and local artifacts out of builds.deploy/nginx/parcel-society.conf.examplethat reverse-proxieshttps://your-domain.comtohttp://127.0.0.1:3000and an updated.env.exampleshowing production env variables.db:deployscript topackages/db/package.jsonwhich usesprisma db pushfor schema deployment in the current repo state.Testing
git diff --checkwas run and reported no whitespace/errors in diffs (success).package.jsonandpackages/db/package.jsonwas performed withpython3and succeeded (success).pnpm installwas attempted but failed due to a403 Forbiddenwhen fetching@tailwindcss/postcssfrom the configured registry, preventing installation ofnode_modules(failed).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 configcould not be run in this environment because Docker is not available (not executed).Codex Task