chore: use mirror/proxy to speed up docker image building

This commit is contained in:
Feng Yue
2025-08-13 14:52:17 +08:00
parent 56e4630827
commit 8ab4ad32fe

View File

@@ -8,7 +8,7 @@ WORKDIR /app/web/admin-spa
COPY web/admin-spa/package*.json ./ COPY web/admin-spa/package*.json ./
# 🔽 安装前端依赖 # 🔽 安装前端依赖
RUN npm ci RUN npm i --registry http://mirrors.tencent.com/npm/
# 📋 复制前端源代码 # 📋 复制前端源代码
COPY web/admin-spa/ ./ COPY web/admin-spa/ ./
@@ -25,7 +25,7 @@ LABEL description="Claude Code API Relay Service"
LABEL version="1.0.0" LABEL version="1.0.0"
# 🔧 安装系统依赖 # 🔧 安装系统依赖
RUN apk add --no-cache \ RUN HTTPS_PROXY=http://114.113.120.5:3128 apk add --no-cache \
curl \ curl \
dumb-init \ dumb-init \
sed \ sed \
@@ -38,7 +38,7 @@ WORKDIR /app
COPY package*.json ./ COPY package*.json ./
# 🔽 安装依赖 (生产环境) # 🔽 安装依赖 (生产环境)
RUN npm ci --only=production && \ RUN npm i --only=production --registry http://mirrors.tencent.com/npm/ && \
npm cache clean --force npm cache clean --force
# 📋 复制应用代码 # 📋 复制应用代码
@@ -68,4 +68,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
# 🚀 启动应用 # 🚀 启动应用
ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"] ENTRYPOINT ["dumb-init", "--", "/usr/local/bin/docker-entrypoint.sh"]
CMD ["node", "src/app.js"] CMD ["node", "src/app.js"]