From 14263e8ea3f24cfb722c1400cc84af00453f08bd Mon Sep 17 00:00:00 2001 From: Jeason <1710884619@qq.com> Date: Tue, 17 Mar 2026 10:44:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=98=BF=E9=87=8C=E4=BA=91?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E5=8A=A0=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/Dockerfile | 6 +++++- frontend/Dockerfile | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 448bd2d..2caac72 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -8,12 +8,16 @@ FROM python:3.11-slim AS base WORKDIR /app +# 使用阿里云镜像加速 apt 和 pip +RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \ + sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true + RUN apt-get update && apt-get install -y --no-install-recommends \ gcc default-libmysqlclient-dev curl \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt # 复制共享模块 COPY shared/ ./shared/ diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 1648394..900535e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -6,11 +6,15 @@ FROM python:3.11-slim WORKDIR /app +# 使用阿里云镜像加速 apt 和 pip +RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \ + sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true + RUN apt-get update && apt-get install -y --no-install-recommends curl \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt COPY . .