ci(docker): 使用国内镜像源加速依赖安装并添加pull命令

修改web和api的Dockerfile,使用国内镜像源加速pnpm和uv的依赖安装
在Makefile中添加pull命令用于拉取基础镜像
This commit is contained in:
Wenjie Zhang 2025-12-03 12:00:58 +08:00
parent 5a66ff80c2
commit 9410313f91
3 changed files with 12 additions and 2 deletions

View File

@ -3,6 +3,16 @@
PYTEST_ARGS ?= PYTEST_ARGS ?=
pull:
bash docker/pull_image.sh python:3.12-slim
bash docker/pull_image.sh node:20-slim
bash docker/pull_image.sh node:20-alpine
bash docker/pull_image.sh quay.io/coreos/etcd:v3.5.5
bash docker/pull_image.sh milvusdb/milvus:v2.5.6
bash docker/pull_image.sh neo4j:5.26
bash docker/pull_image.sh minio/minio:RELEASE.2023-03-20T20-16-18Z
bash docker/pull_image.sh ghcr.io/astral-sh/uv:0.7.2
start: start:
@if [ ! -f .env ]; then \ @if [ ! -f .env ]; then \
echo "Error: .env file not found. Please create it from .env.template"; \ echo "Error: .env file not found. Please create it from .env.template"; \

View File

@ -52,7 +52,7 @@ ENV HTTP_PROXY=$HTTP_PROXY \
# 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple # 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-dev uv sync --no-dev --index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 激活虚拟环境并添加到PATH # 激活虚拟环境并添加到PATH
ENV PATH="/app/.venv/bin:$PATH" ENV PATH="/app/.venv/bin:$PATH"

View File

@ -19,7 +19,7 @@ COPY ./web/package*.json ./
COPY ./web/pnpm-lock.yaml* ./ COPY ./web/pnpm-lock.yaml* ./
# 安装依赖 # 安装依赖
RUN pnpm install RUN pnpm install --registry=https://registry.npmmirror.com
# 复制源代码 # 复制源代码
COPY ./web . COPY ./web .