fix(docker): fix vips package for Alpine 3.23 in file-service

Alpine 3.23 doesn't have vips-dev, use vips runtime instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-26 03:47:56 -08:00
parent 6bb47dad85
commit 89d9645c02
1 changed files with 2 additions and 4 deletions

View File

@ -34,9 +34,6 @@ FROM node:20-alpine AS runner
WORKDIR /app
# 安装 sharp 需要的依赖
RUN apk add --no-cache vips-dev
# 创建非 root 用户
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nestjs
@ -46,7 +43,8 @@ COPY --from=builder /app/packages/services/file-service/dist ./dist
COPY --from=builder /app/packages/services/file-service/package.json ./
# 移除 workspace: 协议依赖并安装生产依赖
RUN apk add --no-cache jq python3 make g++ && \
# vips 是 sharp 运行时需要的图像处理库
RUN apk add --no-cache jq python3 make g++ vips && \
jq 'del(.dependencies["@iconsulting/shared"])' package.json > package.tmp.json && \
mv package.tmp.json package.json && \
npm install --omit=dev && \