# Dockerfile FROM python:3.10-slim # 安装 wkhtmltopdf 及必要依赖 RUN apt-get update && \ apt-get install -y --no-install-recommends \ wkhtmltopdf \ libfontconfig \ && rm -rf /var/lib/apt/lists/* # 设置工作目录 WORKDIR /app # 复制 requirements 并安装 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 复制应用代码 COPY app/ ./app/ RUN chmod -R 777 /app # 端口 EXPOSE 7860 # 启动 CMD ["python", "app/main.py"]