# LibreOffice for DOCX/ODT -> PDF conversion, started on demand per conversion.
#
#   podman build -t inkfisher-pdf container/        (or: ant pdf-image)
#   podman run --rm --network=none -v /srv/inkfisher:/work:Z localhost/inkfisher-pdf offer.docx
#
# /work/in    documents to convert (written by the caller)
# /work/out   PDFs
# /work/log   one log file per run
# /work/fonts optional additional fonts (e.g. corporate fonts)

FROM docker.io/library/debian:trixie-slim

RUN apt-get update \
 && apt-get install -y --no-install-recommends \
      libreoffice-writer-nogui \
      fontconfig \
      fonts-liberation \
      fonts-crosextra-carlito \
      fonts-crosextra-caladea \
      fonts-dejavu-core \
 && rm -rf /var/lib/apt/lists/*

COPY convert.sh /usr/local/bin/convert.sh
RUN chmod 755 /usr/local/bin/convert.sh

# writable for any user (docker --user), LibreOffice profile and font links live here
ENV HOME=/tmp
WORKDIR /work
ENTRYPOINT ["/usr/local/bin/convert.sh"]
