fix: 隔离 LibreOffice 并发转换配置

- 为每次 soffice 调用创建独立临时用户配置目录

- 转换结束后自动清理并保持无头安全启动参数
This commit is contained in:
2026-08-19 22:42:25 +08:00
parent 30b2cc36fd
commit c96f772f01
2 changed files with 23 additions and 1 deletions

View File

@@ -129,8 +129,9 @@ RUN fc-cache -f && \
mkdir -p /app/logs /app/artifacts /app/data && \
chown -R easyflow:easyflow /app
COPY docker-soffice-wrapper.sh /usr/local/bin/soffice
COPY docker-entrypoint.sh /usr/local/bin/easyflow-entrypoint.sh
RUN chmod 755 /usr/local/bin/easyflow-entrypoint.sh
RUN chmod 755 /usr/local/bin/soffice /usr/local/bin/easyflow-entrypoint.sh
VOLUME ["/app/logs", "/app/data"]
EXPOSE 8111

21
docker-soffice-wrapper.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env sh
set -eu
profile_parent="${TMPDIR:-/tmp}"
profile_dir="$(mktemp -d "${profile_parent%/}/easyflow-soffice-XXXXXX")"
cleanup() {
rm -rf -- "$profile_dir"
}
trap cleanup EXIT HUP INT TERM
/usr/bin/soffice \
-env:UserInstallation="file://${profile_dir}" \
--headless \
--safe-mode \
--nologo \
--nodefault \
--nolockcheck \
--norestore \
"$@"