feat: Add vips dependencies for sharp in backend Dockerfile
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Added `vips-dev` and `vips` to build and runtime dependencies. - Updated installation process to ensure compilation of native modules during build.
This commit is contained in:
@ -5,8 +5,8 @@ FROM node:20-alpine AS builder
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install build dependencies for native modules (better-sqlite3)
|
# Install build dependencies for native modules (better-sqlite3, sharp)
|
||||||
RUN apk add --no-cache python3 make g++
|
RUN apk add --no-cache python3 make g++ vips-dev
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
@ -24,11 +24,14 @@ FROM node:20-alpine
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install runtime dependencies (git for simple-git, sqlite3 CLI tool)
|
# Install runtime dependencies (git for simple-git, sqlite3 CLI tool, vips for sharp)
|
||||||
RUN apk add --no-cache git sqlite
|
RUN apk add --no-cache git sqlite vips python3 make g++ vips-dev
|
||||||
|
|
||||||
# Copy production dependencies from builder (already compiled native modules)
|
# Copy package files first
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/package*.json ./
|
||||||
|
|
||||||
|
# Install production dependencies (will compile native modules in this stage)
|
||||||
|
RUN npm ci --omit=dev || npm install --production
|
||||||
|
|
||||||
# Copy built files from builder
|
# Copy built files from builder
|
||||||
COPY --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
|
|||||||
Reference in New Issue
Block a user