fix(web): call next binary directly instead of npx in Dockerfile
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 8s
CI / E2E Tests (push) Has been skipped
CI / AI Services (Python) — Smoke (push) Failing after 5s
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 1m4s
Deploy / Build API Image (push) Failing after 15s
Deploy / Build Web Image (push) Failing after 6s
Deploy / Build AI Services Image (push) Failing after 7s
E2E Tests / Playwright E2E (push) Failing after 11s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 4s
Security Scanning / Trivy Scan — API Image (push) Failing after 48s
Security Scanning / Trivy Scan — Web Image (push) Failing after 37s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 1m40s
Security Scanning / Trivy Filesystem Scan (push) Failing after 1m48s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Security Scanning / Security Gate (push) Failing after 1s
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 8s
CI / E2E Tests (push) Has been skipped
CI / AI Services (Python) — Smoke (push) Failing after 5s
CodeQL Analysis / CodeQL (javascript-typescript) (push) Failing after 1m4s
Deploy / Build API Image (push) Failing after 15s
Deploy / Build Web Image (push) Failing after 6s
Deploy / Build AI Services Image (push) Failing after 7s
E2E Tests / Playwright E2E (push) Failing after 11s
Security Scanning / Dependency Audit (pnpm) (push) Failing after 4s
Security Scanning / Trivy Scan — API Image (push) Failing after 48s
Security Scanning / Trivy Scan — Web Image (push) Failing after 37s
Security Scanning / Trivy Scan — AI Services Image (push) Failing after 1m40s
Security Scanning / Trivy Filesystem Scan (push) Failing after 1m48s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Security Scanning / Security Gate (push) Failing after 1s
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
The hoisted node_modules layout (set in deps stage `.npmrc` with `node-linker=hoisted`) puts `next` at `/app/node_modules/next` only — `apps/web/node_modules/next` doesn't exist. The previous `cd apps/web && npx next build` failed with: Cannot find module '/app/apps/web/node_modules/next/dist/bin/next' because `npx` resolves binaries against the cwd subtree and doesn't walk up. Switching to the explicit binary path `/app/node_modules/.bin/next build` makes the build reproducible in the goodgo Docker image. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,10 @@ COPY --from=deps /app/.npmrc ./
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY tsconfig.base.json ./
|
||||
COPY apps/web/ apps/web/
|
||||
RUN cd apps/web && npx next build
|
||||
# Hoisted layout: `next` binary is in /app/node_modules/.bin/next.
|
||||
# Neither `npx next` nor `pnpm run build` resolve it from apps/web cwd
|
||||
# because that subtree has no node_modules. Call the binary directly.
|
||||
RUN cd apps/web && /app/node_modules/.bin/next build
|
||||
|
||||
# ---- Production ----
|
||||
FROM node:22-slim AS production
|
||||
|
||||
Reference in New Issue
Block a user