The postinstall hook runs scripts/patch-next-dev-blocker.cjs, but at
that point in the Docker build only package.json and package-lock.json
have been copied — the scripts/ directory isn't there yet, so the
hook fails with MODULE_NOT_FOUND.
The patch is dev-only (it mutates Next 16's dev-only cross-site
guard, which is never loaded in production), so it's safe to skip
during the Docker build. Two changes:
1. Dockerfile: use 'npm ci --ignore-scripts' in the deps stage so
the postinstall hook doesn't run before the scripts/ directory
is available.
2. scripts/patch-next-dev-blocker.cjs: bail out cleanly with exit 0
when node_modules/next is missing, so the script is also safe to
run in any intermediate state.