chore: update Dockerfiles to install Typst for PDF rendering and remove WeasyPrint dependencies

This commit is contained in:
Anish Sarkar 2026-02-12 15:57:35 +05:30
parent 828e750320
commit 3336626336
4 changed files with 32 additions and 17 deletions

View file

@ -121,14 +121,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libgbm1 \
libcairo2 \
libpango-1.0-0 \
# ============================
# Report export (WeasyPrint runtime libs — Pandoc installed separately below)
# ============================
libpangoft2-1.0-0 \
libharfbuzz0b \
# 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).
@ -137,6 +129,17 @@ RUN ARCH=$(dpkg --print-architecture) && \
dpkg -i /tmp/pandoc.deb && \
rm /tmp/pandoc.deb
# Install Typst for PDF rendering (Typst has built-in professional styling
# for tables, headings, code blocks, etc., no CSS needed).
RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ]; then TYPST_ARCH="x86_64-unknown-linux-musl"; \
else TYPST_ARCH="aarch64-unknown-linux-musl"; fi && \
wget -qO /tmp/typst.tar.xz "https://github.com/typst/typst/releases/download/v0.13.1/typst-${TYPST_ARCH}.tar.xz" && \
tar -xf /tmp/typst.tar.xz -C /tmp && \
cp /tmp/typst-*/typst /usr/local/bin/typst && \
rm -rf /tmp/typst* && \
typst --version
# Install Node.js 20.x (for running frontend)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \