| | FROM python:3.11-slim |
| |
|
| | WORKDIR /app |
| |
|
| | |
| | RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \ |
| | && sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources |
| |
|
| | |
| | RUN apt-get update && apt-get install -y \ |
| | libnss3 \ |
| | libnspr4 \ |
| | libatk1.0-0 \ |
| | libatk-bridge2.0-0 \ |
| | libcups2 \ |
| | libdrm2 \ |
| | libxkbcommon0 \ |
| | libxcomposite1 \ |
| | libxdamage1 \ |
| | libxfixes3 \ |
| | libxrandr2 \ |
| | libgbm1 \ |
| | libasound2 \ |
| | libpango-1.0-0 \ |
| | libcairo2 \ |
| | && rm -rf /var/lib/apt/lists/* |
| |
|
| | |
| | COPY requirements.txt . |
| | RUN pip install --no-cache-dir -r requirements.txt \ |
| | -i https://pypi.tuna.tsinghua.edu.cn/simple/ \ |
| | --trusted-host pypi.tuna.tsinghua.edu.cn |
| |
|
| | |
| | ENV PLAYWRIGHT_DOWNLOAD_HOST=https://registry.npmmirror.com/-/binary/playwright |
| |
|
| | |
| | RUN playwright install chromium |
| |
|
| | COPY . . |
| |
|
| | EXPOSE 8000 |
| |
|
| | CMD ["python", "main.py"] |
| |
|