From 29da20fa225bc7b13993e5efa3e535cec766af7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Wed, 18 Mar 2026 23:54:41 +0800 Subject: [PATCH] =?UTF-8?q?soffice=20sharp=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 +++++++-- Dockerfile.modelscope | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 976dfdb..f178064 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /app ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 -# 安装系统依赖 +# 安装系统依赖(含 LibreOffice 和 sharp 所需的 libvips) RUN apt-get update && apt-get install -y \ curl \ wget \ @@ -16,6 +16,11 @@ RUN apt-get update && apt-get install -y \ ca-certificates \ libpq-dev \ chromium \ + libreoffice-writer-nogui \ + libreoffice-calc-nogui \ + libreoffice-impress-nogui \ + libvips-dev \ + fonts-noto-cjk \ && rm -rf /var/lib/apt/lists/* # 安装Node.js (支持npx命令) @@ -35,7 +40,7 @@ RUN pip install --no-cache-dir -r requirements.txt # 安装 Playwright 并下载 Chromium RUN pip install --no-cache-dir playwright && \ playwright install chromium -RUN npm install -g playwright && \ +RUN npm install -g playwright sharp && \ npx playwright install chromium # 复制应用代码 diff --git a/Dockerfile.modelscope b/Dockerfile.modelscope index f5fbd55..b1dd0f0 100644 --- a/Dockerfile.modelscope +++ b/Dockerfile.modelscope @@ -8,7 +8,7 @@ WORKDIR /app ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 -# 安装系统依赖 +# 安装系统依赖(含 LibreOffice 和 sharp 所需的 libvips) RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources && \ apt-get update && apt-get install -y \ curl \ @@ -17,6 +17,11 @@ RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/source ca-certificates \ libpq-dev \ chromium \ + libreoffice-writer-nogui \ + libreoffice-calc-nogui \ + libreoffice-impress-nogui \ + libvips-dev \ + fonts-noto-cjk \ && rm -rf /var/lib/apt/lists/* # 安装Node.js (支持npx命令) @@ -36,7 +41,7 @@ RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r req # 安装 Playwright 并下载 Chromium RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ playwright && \ playwright install chromium -RUN npm install -g playwright && \ +RUN npm install -g playwright sharp && \ npx playwright install chromium # 安装modelscope