fix(docker): resolve self-hosting build and OAuth troubleshooting issues#2885
Open
Honey-pg wants to merge 1 commit into
Open
fix(docker): resolve self-hosting build and OAuth troubleshooting issues#2885Honey-pg wants to merge 1 commit into
Honey-pg wants to merge 1 commit into
Conversation
Align Docker with CI using Node 22 and pinned pnpm 11.9, copy pnpm-workspace.yaml for non-interactive build scripts, add native build tools, and improve auth logging for self-hosted deployments.
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
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.
Align Docker with CI using Node 22 and pinned pnpm 11.9, copy
pnpm-workspace.yamlfor non-interactive build scripts, add native build tools, and improve auth logging for self-hosted deployments.Summary
Fixes common Docker self-hosting failures on fresh clones: unpinned Corepack/pnpm version mismatches,
ERR_PNPM_IGNORED_BUILDSfrom missing workspace config during image build, native module compile failures without build tools, and opaque GitHub OAuth errors. Aligns the Docker toolchain with CI (Node 22 + pnpm 11.9) and adds startup auth diagnostics for VPS troubleshooting.Closes #2874
Type of Change
What Changed
Dockerfile: Bump base image tonode:22-alpine; pin pnpm viacorepack prepare pnpm@11.9.0 --activate; copypnpm-workspace.yamlbefore install; addpython3,make, andg++in deps/development stagespackage.json: Add"packageManager": "pnpm@11.9.0"; updateengines.nodeto"20.x || 22.x"; remove deprecatedpnpm.onlyBuiltDependencies(canonical config is inpnpm-workspace.yaml)src/lib/auth-config.ts: New startup validation for GitHub/NextAuth env vars; optionalAUTH_DEBUGlogging helperssrc/lib/auth.ts: Wire NextAuthdebug+logger; improve[auth]log messages during sign-indocs/self-hosting.md/README.md: Add Docker build troubleshooting (pnpm, ignored builds, native deps, OAutherror=github,AUTH_DEBUG)How to Test
docker compose build --no-cachedocker compose upand confirm the app starts athttp://localhost:3000/api/auth/providerswithout GitHub/NextAuth env vars set and check logs for[auth] Self-hosting configuration issuesand[nextauth]messagesExpected result:
pnpm installcompletes withoutERR_PNPM_IGNORED_BUILDS; native packages (sharp,esbuild,tree-sitter) build successfully; container starts; auth misconfiguration produces actionable log output instead of silent OAuth failures.Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
docker compose build --no-cacheanddocker compose upsucceed; auth diagnostics appear when hitting/api/auth/providerswith missing env vars.docker-compose.ymlstill targets thedevelopmentstage (npm run dev). Self-hosters wanting a production image should build the Dockerfileproductiontarget directly — documented indocs/self-hosting.md.AUTH_DEBUG=truein.envfor verbose NextAuth OAuth logs during self-hosting setup.