From e8d13b9a6e91e25661e8918df72cfc5e9336ad45 Mon Sep 17 00:00:00 2001 From: zqlit Date: Sun, 4 Oct 2026 21:33:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker):=20apk=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=B5=B0=E9=98=BF=E9=87=8C=E4=BA=91=E9=95=9C=E5=83=8F=EF=BC=88?= =?UTF-8?q?=E5=9B=BD=E5=86=85=E6=9E=84=E5=BB=BA=E5=AE=9E=E6=B5=8B=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=BA=90=E5=8D=95=E5=8C=85=2030~40s=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editor-api/Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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