File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
44WORKDIR /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
127COPY package.json package-lock.json ./
138
14- # Install with explicit platform support
9+ # Install dependencies (no need for manual native builds usually)
1510RUN 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
2113COPY . .
2214
23- # Build the app
15+ # Build
2416RUN npm run build
2517
26- # Production stage
18+ # Production stage (Alpine is fine here - only serving static files)
2719FROM nginx:alpine
2820
2921# Copy built assets
You can’t perform that action at this time.
0 commit comments