Skip to content

Commit e6ffb42

Browse files
committed
fix(docker): switch builder to node:20-slim to fix native binaries
1 parent c26d883 commit e6ffb42

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

Dockerfile

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
1-
# Build stage
2-
FROM node:20-alpine AS builder
1+
# Build stage (Debian based - better compatibility)
2+
FROM node:20-slim AS builder
33

44
WORKDIR /app
55

6-
# Install build dependencies for native modules
7-
RUN apk add --no-cache python3 make g++ libc6-compat
8-
9-
WORKDIR /app
10-
11-
# Copy package files first (better caching)
6+
# Copy package files
127
COPY package.json package-lock.json ./
138

14-
# Install with explicit platform support
9+
# Install dependencies (no need for manual native builds usually)
1510
RUN npm ci --legacy-peer-deps
1611

17-
# Force install rollup native module for linux musl
18-
RUN npm install @rollup/rollup-linux-x64-musl --save-optional --legacy-peer-deps || true
19-
20-
# Copy source code
12+
# Copy source
2113
COPY . .
2214

23-
# Build the app
15+
# Build
2416
RUN npm run build
2517

26-
# Production stage
18+
# Production stage (Alpine is fine here - only serving static files)
2719
FROM nginx:alpine
2820

2921
# Copy built assets

0 commit comments

Comments
 (0)