原来的yaml:

services:
  stirling-pdf:
    image: stirlingtools/stirling-pdf:latest
    container_name: stirling-pdf
    restart: unless-stopped
    ports:
      - 8083:8080
    environment:
      - SYSTEM_DEFAULTLOCALE=zh-CN
      - SECURITY_ENABLELOGIN=false
      - STIRLING_SHOW_LICENSE_PROMPT=false
    volumes:
      - /volume1/docker/stirling-pdf/configs:/configs:rw
      - /volume1/docker/stirling-pdf/tessdata:/usr/share/tessdata:rw
      - /volume1/docker/stirling-pdf/logs:/logs:rw
    security_opt:
      - no-new-privileges:true
    mem_limit: 2g
    下面是可以直接整段替换的 YAML,适配群晖 Container Manager:
services:
  stirling-pdf:
    image: stirlingtools/stirling-pdf:latest
    container_name: stirling-pdf
    restart: unless-stopped
    ports:
      - 8083:8080
    environment:
      - TZ=Asia/Shanghai
      - SYSTEM_DEFAULTLOCALE=zh-CN
      - SECURITY_ENABLELOGIN=false
      - STIRLING_SHOW_LICENSE_PROMPT=false
      - SYSTEM_GOOGLEVISIBILITY=false
      - SYSTEM_ENABLEANALYTICS=false
    volumes:
      - /volume1/docker/stirling-pdf/configs:/configs:rw
      - /volume1/docker/stirling-pdf/tessdata:/usr/share/tessdata:rw
      - /volume1/docker/stirling-pdf/logs:/logs:rw
      - /volume1/docker/stirling-pdf/customFiles:/customFiles:rw
      - /volume1/docker/stirling-pdf/pipeline:/pipeline:rw
      - /volume1/docker/stirling-pdf/storage:/storage:rw
    security_opt:
      - no-new-privileges:true
    mem_limit: 4g
    healthcheck:
      test: ["CMD-SHELL", "curl -fsS http://localhost:8080/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 5

改了这几处:

  • DISABLE_SECURITY 换成了 SECURITY_ENABLELOGIN=false:新版已经不看 DISABLE_SECURITY 和 DOCKER_ENABLE_SECURITY 了,开关登录要用 SECURITY_ENABLELOGIN。你原来是关登录的,这里照样关着。
  • 补了 3 个挂载目录:customFiles、pipeline、storage 都是官方建议挂出来的,其中 /storage 存放用户保存的文件,默认就是开着的。
  • 内存从 2g 调到 4g:标准的 latest 镜像(带 LibreOffice、OCR、Calibre 这些)官方建议给 4GB,2g 跑大文件容易崩。
  • 加了健康检查、时区和关闭联网统计:这几个是顺手优化,不加也能跑。

操作步骤

  1. 先点右上角「停止」,停掉后再编辑 YAML(运行时是只读的,你截图底部也有提示)。
  2. 整段替换后点「保存」。
  3. 到左侧「映像」找到 stirlingtools/stirling-pdf,点「更新」拉取最新镜像。
  4. 回到项目页点「启动」或「重建」。

注意

  • 升级前最好把 /volume1/docker/stirling-pdf/configs 复制一份备份。首次启动会就地升级里面的数据库,升级后没法回退到旧版本。
  • 你没挂 storage 的话,之前在网页上「保存到服务器」的文件不在这个项目里,不会丢,但升级后第一次启动才挂上,路径是空的。
  • 8083 端口别开到公网。关着登录对外网开放的话,谁都能用你的 NAS 处理 PDF。