Debug next not found: add diagnostic + use direct node invocation
deploy / deploy (push) Failing after 1s

Replace `npm run build` with `node node_modules/next/dist/bin/next build`
to bypass PATH/symlink resolution issues on Alpine. Also adds a diagnostic
`ls node_modules/.bin/next` so CI logs show whether the binary is present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-05-31 15:35:48 +03:30
parent b2ed75cf2d
commit 213a9d4f1c
+4 -1
View File
@@ -20,7 +20,10 @@ RUN if [ -n "$NPM_TOKEN" ]; then \
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
COPY . . COPY . .
RUN npm run build # Diagnose what's in .bin after install, then invoke next directly via node
# to bypass any PATH / symlink resolution issues with `npm run`.
RUN ls node_modules/.bin/next 2>&1 || echo "WARN: next not in .bin" ; \
node node_modules/next/dist/bin/next build
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# 2. Runner — minimal image. Standalone server + static assets only. # 2. Runner — minimal image. Standalone server + static assets only.