From 828e7503205dca802c8244e94a4766bd0c2c0a34 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:32:07 +0530 Subject: [PATCH] chore: update Dockerfiles to install Pandoc 3.x and handle WeasyPrint dependencies --- Dockerfile.allinone | 13 ++++++++++--- surfsense_backend/Dockerfile | 11 +++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Dockerfile.allinone b/Dockerfile.allinone index 46d670961..51f1d8619 100644 --- a/Dockerfile.allinone +++ b/Dockerfile.allinone @@ -122,14 +122,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libcairo2 \ libpango-1.0-0 \ # ============================ - # Report export (Pandoc + WeasyPrint runtime libs) + # Report export (WeasyPrint runtime libs — Pandoc installed separately below) # ============================ - pandoc \ libpangoft2-1.0-0 \ libharfbuzz0b \ - libharfbuzz-subset0 \ + # Try to install libharfbuzz-subset0 (WeasyPrint font subsetting for smaller PDFs). + # Available on Debian Bookworm+ / Ubuntu 24.04+; gracefully skipped on older distros. + && (apt-get install -y --no-install-recommends libharfbuzz-subset0 || true) \ && rm -rf /var/lib/apt/lists/* +# Install Pandoc 3.x from GitHub (apt ships 2.9 which has broken table rendering). +RUN ARCH=$(dpkg --print-architecture) && \ + wget -qO /tmp/pandoc.deb "https://github.com/jgm/pandoc/releases/download/3.9/pandoc-3.9-1-${ARCH}.deb" && \ + dpkg -i /tmp/pandoc.deb && \ + rm /tmp/pandoc.deb + # Install Node.js 20.x (for running frontend) RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs \ diff --git a/surfsense_backend/Dockerfile b/surfsense_backend/Dockerfile index e33a962f8..6efdcc47b 100644 --- a/surfsense_backend/Dockerfile +++ b/surfsense_backend/Dockerfile @@ -20,12 +20,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libxrender1 \ dos2unix \ git \ - pandoc \ libpango-1.0-0 \ libpangoft2-1.0-0 \ - libharfbuzz-subset0 \ + # Try to install libharfbuzz-subset0 (WeasyPrint font subsetting for smaller PDFs). + # Available on Debian Bookworm+ / Ubuntu 24.04+; gracefully skipped on older distros. + && (apt-get install -y --no-install-recommends libharfbuzz-subset0 || true) \ && rm -rf /var/lib/apt/lists/* +# Install Pandoc 3.x from GitHub (apt ships 2.17 which has broken table rendering). +RUN ARCH=$(dpkg --print-architecture) && \ + wget -qO /tmp/pandoc.deb "https://github.com/jgm/pandoc/releases/download/3.9/pandoc-3.9-1-${ARCH}.deb" && \ + dpkg -i /tmp/pandoc.deb && \ + rm /tmp/pandoc.deb + # Update certificates and install SSL tools RUN update-ca-certificates RUN pip install --upgrade certifi pip-system-certs