This change removes unnecessary dependencies and optimizes the PDF build process, enhancing maintainability and reducing potential errors. - Removed `python3-pypandoc` from Dockerfile to minimize dependency footprint. - Replaced `texlive-xetex` with `texlive` in Dockerfile for broader TeX support. - Introduced `subprocess` in `build_pdf.py` to replace `pypandoc`, improving process control. - Added `run_process_with_params` function to handle command execution, increasing code modularity and error handling. - Created `build_pdf.old.py` as a backup of the original script for reference. Signed-off-by: Glenn Y. Rolland <glenux@glenux.net>
46 lines
1.4 KiB
Docker
46 lines
1.4 KiB
Docker
FROM node:18-bookworm-slim
|
|
LABEL maintainer="Glenn ROLLAND glenux@glenux.net"
|
|
|
|
ENV DOCMACHINE_DOCS_ENABLE=1
|
|
ENV DOCMACHINE_SLIDES_ENABLE=1
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends python3 python3-pip python-is-python3 pipenv \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
|
&& truncate -s 0 /var/log/*log
|
|
|
|
# Tools for running the common parts
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends make build-essential inotify-tools gosu unzip curl rsync \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
|
&& truncate -s 0 /var/log/*log
|
|
|
|
# Tools for building pdfs
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends make m4 chromium pandoc ghc libghc-pandoc-dev lmodern texlive texlive-xetex texlive-fonts-extra texlive-fonts-recommended librsvg2-bin fonts-noto-mono \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
|
&& truncate -s 0 /var/log/*log
|
|
|
|
# External tools
|
|
# yq => manage YML
|
|
RUN curl -sSL -o /usr/local/bin/yq \
|
|
https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64 \
|
|
&& chmod +x /usr/local/bin/yq
|
|
|
|
COPY . /app
|
|
COPY .marp /app/.marp
|
|
WORKDIR /app
|
|
|
|
ENV LANG=C.UTF-8 \
|
|
LC_ALL=C.UTF-8 \
|
|
PIPENV_HIDE_EMOJIS=1 \
|
|
PIPENV_VENV_IN_PROJECT=1
|
|
|
|
RUN make prepare SYSTEM_INSTALL=1
|
|
|
|
ENTRYPOINT ["/app/docker/entrypoint.sh"]
|
|
CMD ["watch"]
|
|
|