From 2eaf9759d516a76e3fd85a71718aa1b23b7b3db9 Mon Sep 17 00:00:00 2001 From: Andres Santana Date: Fri, 25 Sep 2026 09:47:51 -0400 Subject: [PATCH] chore(docker): install dependencies inside build container to resolve native optional deps (npm install --no-optional) --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0ad85f5..758d51e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,13 @@ FROM node:22-bullseye-slim AS build WORKDIR /app # Install dependencies first (better layer caching) -COPY package.json package-lock.json ./ +# Do not copy package-lock.json: regenerate inside the build container so +# optional/native deps are resolved for the build host platform (avoids +# npm/optional-deps bug where lockfile pins a different platform binary). +COPY package.json ./ COPY apps/web/package.json apps/web/package.json -# Avoid optional native optional deps that fail on some builder environments -RUN npm ci --no-optional +# Install resolving optional native deps for the current builder platform +RUN npm install --no-optional --no-audit --no-fund # Copy source and build the static site COPY apps/web apps/web