From 2a99540e5a633c8b835b1ea7881435432223a367 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Mon, 4 May 2026 01:04:32 -0300 Subject: [PATCH] fix(docker): drop host package-lock.json before npm install in build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- Dockerfile.standalone | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile.standalone b/Dockerfile.standalone index a00a13a5..76d3772e 100644 --- a/Dockerfile.standalone +++ b/Dockerfile.standalone @@ -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 ----