Skip to content

Commit 9410313

Browse files
committed
ci(docker): 使用国内镜像源加速依赖安装并添加pull命令
修改web和api的Dockerfile,使用国内镜像源加速pnpm和uv的依赖安装 在Makefile中添加pull命令用于拉取基础镜像
1 parent 5a66ff8 commit 9410313

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33

44
PYTEST_ARGS ?=
55

6+
pull:
7+
bash docker/pull_image.sh python:3.12-slim
8+
bash docker/pull_image.sh node:20-slim
9+
bash docker/pull_image.sh node:20-alpine
10+
bash docker/pull_image.sh quay.io/coreos/etcd:v3.5.5
11+
bash docker/pull_image.sh milvusdb/milvus:v2.5.6
12+
bash docker/pull_image.sh neo4j:5.26
13+
bash docker/pull_image.sh minio/minio:RELEASE.2023-03-20T20-16-18Z
14+
bash docker/pull_image.sh ghcr.io/astral-sh/uv:0.7.2
15+
616
start:
717
@if [ ! -f .env ]; then \
818
echo "Error: .env file not found. Please create it from .env.template"; \

docker/api.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ENV HTTP_PROXY=$HTTP_PROXY \
5252

5353
# 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
5454
RUN --mount=type=cache,target=/root/.cache/uv \
55-
uv sync --no-dev
55+
uv sync --no-dev --index-url https://pypi.tuna.tsinghua.edu.cn/simple
5656

5757
# 激活虚拟环境并添加到PATH
5858
ENV PATH="/app/.venv/bin:$PATH"

docker/web.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ COPY ./web/package*.json ./
1919
COPY ./web/pnpm-lock.yaml* ./
2020

2121
# 安装依赖
22-
RUN pnpm install
22+
RUN pnpm install --registry=https://registry.npmmirror.com
2323

2424
# 复制源代码
2525
COPY ./web .

0 commit comments

Comments
 (0)