| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- FROM python:3.10-slim
- # 设置工作目录
- WORKDIR /app
- # 安装系统依赖(Playwright 所需)
- RUN apt-get update && apt-get install -y \
- wget \
- gnupg \
- libnss3 \
- libnspr4 \
- libatk1.0-0 \
- libatk-bridge2.0-0 \
- libcups2 \
- libdrm2 \
- libdbus-1-3 \
- libxcb1 \
- libxdamage1 \
- libxext6 \
- libxfixes3 \
- libxrandr2 \
- libxcomposite1 \
- libx11-xcb1 \
- libxkbcommon0 \
- libxshmfence1 \
- && rm -rf /var/lib/apt/lists/*
- # 复制项目文件
- COPY requirements.txt .
- COPY *.py ./
- # 安装 Python 依赖
- RUN pip install --no-cache-dir -r requirements.txt
- # 安装 Playwright 浏览器
- RUN playwright install chromium
- # 设置环境变量
- ENV PYTHONUNBUFFERED=1
- # 启动应用
- CMD ["python", "run.py"]
|