chore(docker): install dependencies inside build container to resolve native optional deps (npm install --no-optional)
This commit is contained in:
+6
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user