soffice sharp 支持

This commit is contained in:
朱潮 2026-03-18 23:55:14 +08:00
commit 3c01f9c245
2 changed files with 14 additions and 4 deletions

View File

@ -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 \
@ -17,6 +17,11 @@ RUN apt-get update && apt-get install -y \
libpq-dev \
chromium \
ffmpeg \
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 -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
# 复制应用代码

View File

@ -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 \
@ -18,6 +18,11 @@ RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/source
libpq-dev \
chromium \
ffmpeg \
libreoffice-writer-nogui \
libreoffice-calc-nogui \
libreoffice-impress-nogui \
libvips-dev \
fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/*
# 安装Node.js (支持npx命令)
@ -37,7 +42,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