feat: Add vips dependencies for sharp in backend Dockerfile
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Added `vips-dev` and `vips` to build and runtime dependencies. - Updated installation process to ensure compilation
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user