提交 26d8d11e authored 作者: 陈泽健's avatar 陈泽健

fix(deploy): 添加国内镜像源加速构建(清华PyPI + npmmirror)

- 后端 pip 使用清华镜像避免 BrokenPipe 超时
- 前端 npm 使用 npmmirror 加速依赖下载
- 增加 pip 重试次数和超时配置
Co-Authored-By: 's avatarClaude <noreply@anthropic.com>
上级 2133790d
......@@ -25,9 +25,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libasound2t64 \
&& rm -rf /var/lib/apt/lists/*
# 安装 Python 依赖
# 安装 Python 依赖(使用国内镜像源加速,支持重试)
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn --retries 5 --timeout 120 -r requirements.txt
# 安装 Playwright Chromium(Linux 版本)
RUN playwright install chromium
......
......@@ -3,9 +3,9 @@ FROM node:20-alpine AS build
WORKDIR /app
# 安装依赖
# 安装依赖(使用国内镜像)
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
RUN npm config set registry https://registry.npmmirror.com && npm ci
# 复制源码并构建
COPY frontend/ .
......
{
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论