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:
parent
6bb47dad85
commit
89d9645c02
|
|
@ -34,9 +34,6 @@ FROM node:20-alpine AS runner
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 安装 sharp 需要的依赖
|
|
||||||
RUN apk add --no-cache vips-dev
|
|
||||||
|
|
||||||
# 创建非 root 用户
|
# 创建非 root 用户
|
||||||
RUN addgroup --system --gid 1001 nodejs && \
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
adduser --system --uid 1001 nestjs
|
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 ./
|
COPY --from=builder /app/packages/services/file-service/package.json ./
|
||||||
|
|
||||||
# 移除 workspace: 协议依赖并安装生产依赖
|
# 移除 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 && \
|
jq 'del(.dependencies["@iconsulting/shared"])' package.json > package.tmp.json && \
|
||||||
mv package.tmp.json package.json && \
|
mv package.tmp.json package.json && \
|
||||||
npm install --omit=dev && \
|
npm install --omit=dev && \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue