This commit is contained in:
jeremygan2021
2026-02-16 19:38:21 +08:00
parent 4467d5211e
commit 378dda7af5

View File

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