fix: use node:22-bookworm (Debian) instead of Alpine for sharp compatibility
This commit is contained in:
26
Dockerfile
26
Dockerfile
@@ -1,30 +1,29 @@
|
||||
# ============================================================
|
||||
# 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
|
||||
RUN apk add --no-cache \
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
py3-pip \
|
||||
make \
|
||||
g++ \
|
||||
gcc \
|
||||
libc-dev \
|
||||
vips-dev \
|
||||
libvips-dev \
|
||||
poppler-utils \
|
||||
pkgconfig
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm and node-gyp globally
|
||||
# Install pnpm globally
|
||||
RUN npm install -g pnpm@10.4.1 node-gyp
|
||||
|
||||
# Copy package files
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Install ALL dependencies (including devDeps for build)
|
||||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy source code
|
||||
@@ -36,13 +35,14 @@ RUN pnpm build
|
||||
# ============================================================
|
||||
# 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)
|
||||
RUN apk add --no-cache \
|
||||
# Install runtime dependencies only
|
||||
RUN apt-get update && apt-get install -y \
|
||||
poppler-utils \
|
||||
vips \
|
||||
curl
|
||||
libvips42 \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user