FROM python:3.10-slim WORKDIR /app # 安装系统依赖 RUN apt-get update && \ apt-get install -y --no-install-recommends libopus0 ffmpeg && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # 配置pip使用清华镜像源,并设置超时和重试 RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \ pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn && \ pip config set global.timeout 120 && \ pip config set install.retries 5 # 复制requirements.txt COPY app_bot/requirements.txt . # 安装Python依赖 RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ pip install --no-cache-dir -r requirements.txt --default-timeout=120 --retries 5 COPY app_bot/ . CMD ["python", "app.py"]