soffice sharp 支持

This commit is contained in:
朱潮 2026-03-18 23:54:41 +08:00
parent e2e0a7d985
commit 29da20fa22
2 changed files with 14 additions and 4 deletions

View File

@ -8,7 +8,7 @@ WORKDIR /app
ENV PYTHONPATH=/app ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
# 安装系统依赖 # 安装系统依赖(含 LibreOffice 和 sharp 所需的 libvips
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
curl \ curl \
wget \ wget \
@ -16,6 +16,11 @@ RUN apt-get update && apt-get install -y \
ca-certificates \ ca-certificates \
libpq-dev \ libpq-dev \
chromium \ chromium \
libreoffice-writer-nogui \
libreoffice-calc-nogui \
libreoffice-impress-nogui \
libvips-dev \
fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# 安装Node.js (支持npx命令) # 安装Node.js (支持npx命令)
@ -35,7 +40,7 @@ RUN pip install --no-cache-dir -r requirements.txt
# 安装 Playwright 并下载 Chromium # 安装 Playwright 并下载 Chromium
RUN pip install --no-cache-dir playwright && \ RUN pip install --no-cache-dir playwright && \
playwright install chromium playwright install chromium
RUN npm install -g playwright && \ RUN npm install -g playwright sharp && \
npx playwright install chromium npx playwright install chromium
# 复制应用代码 # 复制应用代码

View File

@ -8,7 +8,7 @@ WORKDIR /app
ENV PYTHONPATH=/app ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1 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 && \ 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 \ apt-get update && apt-get install -y \
curl \ curl \
@ -17,6 +17,11 @@ RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/source
ca-certificates \ ca-certificates \
libpq-dev \ libpq-dev \
chromium \ chromium \
libreoffice-writer-nogui \
libreoffice-calc-nogui \
libreoffice-impress-nogui \
libvips-dev \
fonts-noto-cjk \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# 安装Node.js (支持npx命令) # 安装Node.js (支持npx命令)
@ -36,7 +41,7 @@ RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r req
# 安装 Playwright 并下载 Chromium # 安装 Playwright 并下载 Chromium
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ playwright && \ RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ playwright && \
playwright install chromium playwright install chromium
RUN npm install -g playwright && \ RUN npm install -g playwright sharp && \
npx playwright install chromium npx playwright install chromium
# 安装modelscope # 安装modelscope