@@ -43,7 +43,7 @@ RUN apt-add-repository multiverse && \
4343RUN apt-get install apt-fast -y --no-install-recommends
4444
4545# install req packages
46- RUN apt-fast install -y --no-install-recommends python3-all-dev python3-dev python3.12 python3-pip libpython3.12-dev python3.12-dev python3.12-venv
46+ RUN apt-fast install -y --no-install-recommends python3-all-dev python3-dev python3.12 python3-pip libpython3.12-dev python3.12-dev python3.12-venv python3-uno
4747RUN apt-fast -y --no-install-recommends -o Dpkg::Options::="--force-confold" -y -o Dpkg::Options::="--force-confdef" -fuy dist-upgrade && \
4848 apt-fast install -y --no-install-recommends \
4949 gnupg \
@@ -108,6 +108,23 @@ RUN mkdir /ocr_service
108108COPY ./ /ocr_service
109109WORKDIR /ocr_service
110110
111+ # --- Install system-wide unoserver to match requirements.txt (for UNO/system Python) ---
112+ # BEFORE creating the venv so /usr/bin/python3.12 can run unoserver
113+ # the reason for this is that the uno python bindings are tied to the system python
114+ # and will not work in a venv
115+ # so we need to install unoserver globally to match the version in requirements.txt
116+ # this is a bit hacky but it works around the issue of unoserver not being available
117+ # via pip for python3.12 (as of 2025-08)
118+ RUN UNOSERVER_PIN=$(awk -F'==' '/^unoserver==/ {print $2; exit}' requirements.txt || true) && \
119+ if [ -n "$UNOSERVER_PIN" ]; then \
120+ echo "Installing system unoserver==$UNOSERVER_PIN" ; \
121+ pip3 install --no-cache-dir --break-system-packages "unoserver==$UNOSERVER_PIN" ; \
122+ else \
123+ echo "No exact pin found for unoserver in requirements.txt; installing latest system unoserver" ; \
124+ pip3 install --no-cache-dir --break-system-packages unoserver; \
125+ fi
126+ # --- end unoserver system install ---
127+
111128# Use a virtual environment for Python deps (single-stage build)
112129ENV VIRTUAL_ENV=/opt/venv
113130ENV PATH="$VIRTUAL_ENV/bin:$PATH"
0 commit comments