diff --git a/editor-api/Dockerfile b/editor-api/Dockerfile index fbbb5860..9c7287ec 100644 --- a/editor-api/Dockerfile +++ b/editor-api/Dockerfile @@ -10,7 +10,15 @@ FROM node:22-alpine # git:发布用。ca-certificates:https 远端(CNB / GitHub)要它 -RUN apk add --no-cache git ca-certificates +# +# ★ apk 源默认换成阿里云镜像:国内机器直连 dl-cdn.alpinelinux.org 实测慢到不可用 +# (单个包 30~40 秒,12 个包要 7 分钟),换源后几秒装完。 +# 境外机器想用官方源就 --build-arg APK_MIRROR= 传空值。 +ARG APK_MIRROR=mirrors.aliyun.com +RUN if [ -n "$APK_MIRROR" ]; then \ + sed -i "s#dl-cdn.alpinelinux.org#$APK_MIRROR#g" /etc/apk/repositories; \ + fi \ + && apk add --no-cache git ca-certificates WORKDIR /app ENV NODE_ENV=production