From ccc5c028ba6a01f57884244a14ca64ab1b87a88d Mon Sep 17 00:00:00 2001 From: Kenzo Date: Tue, 9 Dec 2025 18:00:32 +0100 Subject: [PATCH] feat: Add vips dependencies for sharp in backend Dockerfile - Added `vips-dev` and `vips` to build and runtime dependencies. - Updated installation process to ensure compilation --- backend/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 1b608bc..fb74fab 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -25,14 +25,19 @@ FROM node:20-alpine WORKDIR /app # Install runtime dependencies (git for simple-git, sqlite3 CLI tool, vips for sharp) -RUN apk add --no-cache git sqlite vips python3 make g++ vips-dev +# Note: python3, make, g++ are needed for native module compilation +RUN apk add --no-cache git sqlite vips vips-dev python3 make g++ # Copy package files first COPY --from=builder /app/package*.json ./ -# Install production dependencies (will compile native modules in this stage) +# Rebuild sharp for the correct architecture (linuxmusl-x64) +# Install all production dependencies RUN npm ci --omit=dev || npm install --production +# Clean up build dependencies after installation to reduce image size +RUN apk del python3 make g++ vips-dev + # Copy built files from builder COPY --from=builder /app/dist ./dist COPY --from=builder /app/src/db/migrations ./dist/db/migrations