From 9410313f91d8a45ca46a01d117fa4b89882adb3a Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Wed, 3 Dec 2025 12:00:58 +0800 Subject: [PATCH] =?UTF-8?q?ci(docker):=20=E4=BD=BF=E7=94=A8=E5=9B=BD?= =?UTF-8?q?=E5=86=85=E9=95=9C=E5=83=8F=E6=BA=90=E5=8A=A0=E9=80=9F=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=AE=89=E8=A3=85=E5=B9=B6=E6=B7=BB=E5=8A=A0pull?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改web和api的Dockerfile,使用国内镜像源加速pnpm和uv的依赖安装 在Makefile中添加pull命令用于拉取基础镜像 --- Makefile | 10 ++++++++++ docker/api.Dockerfile | 2 +- docker/web.Dockerfile | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c0559fc9..103e336f 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,16 @@ 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: @if [ ! -f .env ]; then \ echo "Error: .env file not found. Please create it from .env.template"; \ diff --git a/docker/api.Dockerfile b/docker/api.Dockerfile index bf6e87fc..30d1865f 100644 --- a/docker/api.Dockerfile +++ b/docker/api.Dockerfile @@ -52,7 +52,7 @@ ENV HTTP_PROXY=$HTTP_PROXY \ # 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple 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 ENV PATH="/app/.venv/bin:$PATH" diff --git a/docker/web.Dockerfile b/docker/web.Dockerfile index da6c99fb..b6101e9e 100644 --- a/docker/web.Dockerfile +++ b/docker/web.Dockerfile @@ -19,7 +19,7 @@ COPY ./web/package*.json ./ COPY ./web/pnpm-lock.yaml* ./ # 安装依赖 -RUN pnpm install +RUN pnpm install --registry=https://registry.npmmirror.com # 复制源代码 COPY ./web .