From bb0b62b87e6d2e6e9f50c1ff99702d03fd2825b8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 2 Oct 2025 05:47:38 +0000 Subject: [PATCH 1/2] Add nixpacks.toml for Dokploy (Next.js + pnpm + Node 20) Provide reproducible Nixpacks build with pnpm, cache store, and start binding to 0.0.0.0 using $PORT for Dokploy. --- nixpacks.toml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 nixpacks.toml diff --git a/nixpacks.toml b/nixpacks.toml new file mode 100644 index 00000000..28aade82 --- /dev/null +++ b/nixpacks.toml @@ -0,0 +1,30 @@ +# Nixpacks configuration for Next.js (pnpm) +# Docs: https://nixpacks.com/docs/reference/configuration + +providers = ["node"] + +[phases.setup] +# Use Node 20 and pnpm from nixpkgs for reproducibility +nixPkgs = ["nodejs_20", "pnpm"] + +[variables] +NODE_ENV = "production" +NEXT_TELEMETRY_DISABLED = "1" + +[phases.install] +dependsOn = ["setup"] +cmds = [ + "pnpm install --frozen-lockfile" +] +# Persist pnpm store between builds for faster installs +cacheDirectories = ["~/.pnpm-store"] + +[phases.build] +dependsOn = ["install"] +cmds = [ + "pnpm run build" +] + +[start] +# Bind to 0.0.0.0 and use Dokploy-provided $PORT +cmd = "pnpm run start -- -H 0.0.0.0 -p ${PORT:-3000}" From cc69e70fc0a4b1937bd25d04692d86528be09810 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 05:19:46 +0000 Subject: [PATCH 2/2] fix: restore Nixpacks build compatibility after upstream sync Two upstream changes broke the Nixpacks build on Dokploy: 1. NODE_ENV=production was set globally, causing pnpm to skip devDependencies during install. The build needs TypeScript, Tailwind, eslint-config-next, etc. which live in devDependencies. 2. The upstream added "prepare": "husky" to package.json. Husky's prepare hook fails in Nixpacks build containers which lack a proper git hooks environment. Fix: remove NODE_ENV from global variables (devDeps now install correctly), add HUSKY=0 to suppress the prepare hook, and move NODE_ENV=production to only the start command where it matters. https://claude.ai/code/session_01UexnxJf2naqbNGnaMn7NUs --- nixpacks.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixpacks.toml b/nixpacks.toml index 28aade82..d23af23f 100644 --- a/nixpacks.toml +++ b/nixpacks.toml @@ -8,8 +8,8 @@ providers = ["node"] nixPkgs = ["nodejs_20", "pnpm"] [variables] -NODE_ENV = "production" NEXT_TELEMETRY_DISABLED = "1" +HUSKY = "0" [phases.install] dependsOn = ["setup"] @@ -27,4 +27,4 @@ cmds = [ [start] # Bind to 0.0.0.0 and use Dokploy-provided $PORT -cmd = "pnpm run start -- -H 0.0.0.0 -p ${PORT:-3000}" +cmd = "NODE_ENV=production pnpm run start -- -H 0.0.0.0 -p ${PORT:-3000}"