From d6ef1464c3b8b80e5863d715afec9dac167679b1 Mon Sep 17 00:00:00 2001 From: Tibor Casteleijn Date: Tue, 1 Sep 2026 17:09:24 +0200 Subject: [PATCH] breaking(joex): replace unoconv with unoserver for office conversion Start unoserver in the joex entrypoint (with unoping readiness) and install LibreOffice + unoserver instead of the deprecated unoconv package. Concurrent converts are queued by the server, avoiding LibreOffice listener deadlocks (eikek/docspell#3345). Co-authored-by: Cursor --- images/Dockerfile.joex | 7 +++++-- images/joex-entrypoint.sh | 24 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/images/Dockerfile.joex b/images/Dockerfile.joex index 4862303..e6b685d 100644 --- a/images/Dockerfile.joex +++ b/images/Dockerfile.joex @@ -16,7 +16,9 @@ RUN apt install -y \ ghostscript \ unpaper \ weasyprint \ - unoconv \ + libreoffice \ + python3-uno \ + python3-pip \ python3-distutils-extra \ fonts-droid-fallback \ fonts-dejavu \ @@ -25,7 +27,8 @@ RUN apt install -y \ pngquant \ ocrmypdf \ qpdf \ - docker-ce-cli + docker-ce-cli \ + && pip3 install --break-system-packages --no-cache-dir unoserver FROM base AS download diff --git a/images/joex-entrypoint.sh b/images/joex-entrypoint.sh index 4674ff4..25dbdbb 100755 --- a/images/joex-entrypoint.sh +++ b/images/joex-entrypoint.sh @@ -1,7 +1,25 @@ #!/bin/sh -echo "Starting unoconv listener" -unoconv -l & +set -e -/opt/docspell-joex/bin/docspell-joex "$@" +echo "Starting unoserver" +# Queues office converts so concurrent joex workers do not deadlock LibreOffice. +# See https://github.com/eikek/docspell/issues/3345 +unoserver --conversion-timeout 120 & + +echo "Waiting for unoserver to become ready" +i=0 +while [ "$i" -lt 60 ]; do + if unoping >/dev/null 2>&1; then + echo "unoserver is ready" + break + fi + i=$((i + 1)) + sleep 1 +done +if ! unoping >/dev/null 2>&1; then + echo "WARNING: unoserver did not become ready within 60s; office conversion may fail" >&2 +fi + +/opt/docspell-joex/bin/docspell-joex "$@"