File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 11# Build stage
2- FROM node:22-alpine AS builder
2+ FROM node:22-slim AS builder
33
4- # Install dependencies
5- RUN apk add --no-cache libc6-compat python3 make g++
4+ # Install build dependencies
5+ RUN apt-get update && apt-get install -y --no-install-recommends \
6+ python3 \
7+ make \
8+ g++ \
9+ && rm -rf /var/lib/apt/lists/*
610
711WORKDIR /app
812
913# Copy package files
10- COPY package.json package-lock.json* ./
14+ COPY package.json ./
1115
12- # Install dependencies with optional dependencies
13- # The --include=optional flag ensures rollup native binaries are installed
14- RUN npm install --include=optional || (rm -f package-lock.json && npm install --include=optional)
16+ # Remove package-lock.json and node_modules as suggested by the error message
17+ # This fixes npm's bug with optional dependencies
18+ RUN rm -rf package-lock.json node_modules 2>/dev/null || true
19+
20+ # Install dependencies fresh (this ensures rollup native binaries are properly installed)
21+ RUN npm install --include=optional
1522
1623# Copy source code
1724COPY . .
You can’t perform that action at this time.
0 commit comments