chore(docker): install dependencies inside build container to resolve native optional deps (npm install --no-optional)

This commit is contained in:
Andres Santana
2026-09-25 09:47:51 -04:00
parent a808fdee9e
commit 2eaf9759d5
+6 -3
View File
@@ -3,10 +3,13 @@ FROM node:22-bullseye-slim AS build
WORKDIR /app WORKDIR /app
# Install dependencies first (better layer caching) # 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 COPY apps/web/package.json apps/web/package.json
# Avoid optional native optional deps that fail on some builder environments # Install resolving optional native deps for the current builder platform
RUN npm ci --no-optional RUN npm install --no-optional --no-audit --no-fund
# Copy source and build the static site # Copy source and build the static site
COPY apps/web apps/web COPY apps/web apps/web