fix(docker): drop host package-lock.json before npm install in build
Lock files generated on Windows/macOS pin platform-specific Rollup native binaries (e.g. @rollup/rollup-win32-x64-msvc) and won't bring in the Linux ones the Docker image needs. Symptom: `MODULE_NOT_FOUND` on `rollup/dist/native.js` during `npm run build:docker`. See npm/cli#4828. Removing the lock inside the build forces a fresh, Linux-native dep resolution. Side effect: a tiny loss of cross-build version pinning, which is acceptable here — `npm install` honours the version ranges in package.json so semver-compatible patches at most slip in. The proper long-term fix is to regenerate package-lock.json on Linux and commit that. Until then this rm guards every Docker build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
38e59cb49d
commit
2a99540e5a
|
|
@ -76,7 +76,14 @@ WORKDIR /app
|
|||
COPY frontend/ frontend/
|
||||
COPY scripts/ scripts/
|
||||
WORKDIR /app/frontend
|
||||
RUN npm install && npm run build:docker
|
||||
# Drop any host-generated package-lock.json before installing. A lock
|
||||
# generated on Windows/macOS pins platform-specific Rollup/esbuild binaries
|
||||
# (e.g. @rollup/rollup-win32-x64-msvc) and won't install the Linux variants
|
||||
# this image needs — manifests as MODULE_NOT_FOUND in rollup/dist/native.js
|
||||
# during the build. See npm/cli#4828.
|
||||
RUN rm -f package-lock.json \
|
||||
&& npm install --include=optional \
|
||||
&& npm run build:docker
|
||||
|
||||
|
||||
# ---- Stage 2: Final Production Image ----
|
||||
|
|
|
|||
Loading…
Reference in New Issue