diff --git a/Dockerfile b/Dockerfile index ba9c5e5..9ed4c19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.13-slim AS base ENV VIRTUAL_ENV=/app/.venv \ PATH="/app/.venv/bin:$PATH" \ - PLAYWRIGHT_BROWSERS_PATH=0 + PLAYWRIGHT_BROWSERS_PATH=/usr/lib/pw-browsers # 安装所有都需要的底层依赖 RUN apt-get update && \ @@ -18,6 +18,10 @@ RUN apt-get update && \ fonts-noto-color-emoji \ && rm -rf /var/lib/apt/lists/* +RUN pip install --no-cache-dir playwright \ + && python -m playwright install chromium \ + && pip uninstall -y playwright + FROM base AS builder @@ -42,8 +46,6 @@ COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} WORKDIR /app -RUN python -m playwright install chromium - COPY bot.py pyproject.toml .env.prod .env.test ./ COPY assets ./assets COPY scripts ./scripts