From 380764d5edff0aba6184b8e7ecf58543fcb07510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Tue, 17 Mar 2026 14:48:50 +0800 Subject: [PATCH] add chromium --- Dockerfile | 10 +++++----- Dockerfile.modelscope | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a935019..976dfdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,6 @@ WORKDIR /app # 设置环境变量 ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 -ENV PLAYWRIGHT_BROWSERS_PATH=/usr -ENV CHROME_PATH=/usr/bin/chromium # 安装系统依赖 RUN apt-get update && apt-get install -y \ @@ -34,9 +32,11 @@ ENV PATH="/root/.cargo/bin:$PATH" COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -# 安装 Playwright (使用系统 chromium,无需额外下载) -RUN pip install --no-cache-dir playwright -RUN npm install -g playwright +# 安装 Playwright 并下载 Chromium +RUN pip install --no-cache-dir playwright && \ + playwright install chromium +RUN npm install -g playwright && \ + npx playwright install chromium # 复制应用代码 COPY . . diff --git a/Dockerfile.modelscope b/Dockerfile.modelscope index e1e5eeb..f5fbd55 100644 --- a/Dockerfile.modelscope +++ b/Dockerfile.modelscope @@ -7,8 +7,6 @@ WORKDIR /app # 设置环境变量 ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 -ENV PLAYWRIGHT_BROWSERS_PATH=/usr -ENV CHROME_PATH=/usr/bin/chromium # 安装系统依赖 RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources && \ @@ -35,9 +33,11 @@ ENV PATH="/root/.cargo/bin:$PATH" COPY requirements.txt . RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt -# 安装 Playwright (使用系统 chromium,无需额外下载) -RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ playwright -RUN npm install -g playwright +# 安装 Playwright 并下载 Chromium +RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ playwright && \ + playwright install chromium +RUN npm install -g playwright && \ + npx playwright install chromium # 安装modelscope #RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ modelscope