chore: optimize local crawler image build

This commit is contained in:
hajimi
2026-08-01 17:01:29 +08:00
parent 9a83c8dfb7
commit 40619e2335
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -3,6 +3,7 @@ FROM python:3.11-slim-bookworm
ENV TZ=Asia/Shanghai \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple \
DQD_CONFIG_PATH=/app/config/settings.yaml \
DQD_TASKS_FILE=/app/config/crawler_tasks.yaml \
DQD_LOCK_DIR=/app/data/locks
@@ -22,8 +23,10 @@ RUN apt-get update \
COPY requirements.txt /app/requirements.txt
RUN python -m pip install --upgrade pip setuptools wheel \
&& python -m pip install -r /app/requirements.txt \
&& python -m playwright install --with-deps chromium
&& python -m pip install -r /app/requirements.txt
# API 型采集任务不依赖 Chromium。浏览器型采集需要时再在镜像内单独安装,
# 避免本地首次构建因浏览器下载通道不可达而阻塞整个调度器。
COPY . /app