diff --git a/docker/Dockerfile b/docker/Dockerfile index 8b887e8f..32e705a4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -46,8 +46,14 @@ WORKDIR /app # build.rs) can produce the release binary with embedded frontend assets. COPY . . -# Build frontend deps first (better layer caching) -RUN cd frontend && npm ci +# Build frontend deps first (better layer caching). +# `npm ci` alone hits npm's optional-dependencies bug (npm/cli#4828): +# platform-specific bindings (e.g. @rolldown/binding-linux-arm64-gnu) +# listed in package-lock.json for the lockfile author's platform are +# not installed for the build platform. Follow `npm ci` with a +# `--no-save --include=optional` install so the build platform's +# native binding is fetched without mutating the lockfile. +RUN cd frontend && npm ci && npm install --include=optional --no-save # Build the release binary (build.rs runs npm run build for the frontend) RUN cargo build --release \