fix: use node:22-bookworm (Debian) instead of Alpine for sharp compatibility

This commit is contained in:
Manus Deploy
2026-04-28 12:40:45 -04:00
parent 8bf2001693
commit ba16596dc0

View File

@@ -1,30 +1,29 @@
# ============================================================ # ============================================================
# STAGE 1: Build Frontend + Backend # STAGE 1: Build Frontend + Backend
# ============================================================ # ============================================================
FROM node:22-alpine AS builder FROM node:22-bookworm AS builder
# Install system dependencies for sharp and pdf processing # Install system dependencies for sharp and pdf processing
RUN apk add --no-cache \ RUN apt-get update && apt-get install -y \
python3 \ python3 \
py3-pip \
make \ make \
g++ \ g++ \
gcc \ gcc \
libc-dev \ libvips-dev \
vips-dev \
poppler-utils \ poppler-utils \
pkgconfig pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app
# Install pnpm and node-gyp globally # Install pnpm globally
RUN npm install -g pnpm@10.4.1 node-gyp RUN npm install -g pnpm@10.4.1 node-gyp
# Copy package files # Copy package files
COPY package.json pnpm-lock.yaml ./ COPY package.json pnpm-lock.yaml ./
COPY patches/ ./patches/ COPY patches/ ./patches/
# Install ALL dependencies (including devDeps for build) # Install dependencies
RUN pnpm install --frozen-lockfile RUN pnpm install --frozen-lockfile
# Copy source code # Copy source code
@@ -36,13 +35,14 @@ RUN pnpm build
# ============================================================ # ============================================================
# STAGE 2: Production image # STAGE 2: Production image
# ============================================================ # ============================================================
FROM node:22-alpine AS production FROM node:22-bookworm-slim AS production
# Install runtime dependencies only (vips for sharp, poppler for PDF) # Install runtime dependencies only
RUN apk add --no-cache \ RUN apt-get update && apt-get install -y \
poppler-utils \ poppler-utils \
vips \ libvips42 \
curl curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app WORKDIR /app