From 378dda7af54a0be1a249d0e6284d0aa794e29998 Mon Sep 17 00:00:00 2001 From: jeremygan2021 Date: Mon, 16 Feb 2026 19:38:21 +0800 Subject: [PATCH] docker --- Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index de8f60b..7e0afdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,18 @@ FROM python:3.12 WORKDIR /app +# 替换 Debian 软件源为阿里云镜像 (加速 apt-get) +RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources + +# 配置 pip 全局使用阿里云镜像源 +ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple +ENV PIP_TRUSTED_HOST=mirrors.aliyun.com + COPY requirements.txt . COPY .env . -RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple +# 安装依赖 +RUN pip install --no-cache-dir -r requirements.txt COPY . .