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 . .