experimental alpine support for diagram feature (sometimes hangs?)

This commit is contained in:
Jörn-Michael Miehe 2024-11-19 01:48:10 +01:00
parent 91699e95ca
commit 5b8786fb33

View file

@ -1,4 +1,4 @@
FROM pandoc/extra:latest FROM pandoc/extra:latest AS stage-base
RUN set -ex; \ RUN set -ex; \
\ \
@ -20,3 +20,29 @@ COPY src/usr /usr
WORKDIR /docs WORKDIR /docs
ENTRYPOINT ["autodoc"] ENTRYPOINT ["autodoc"]
CMD ["-bw"] CMD ["-bw"]
FROM stage-base AS stage-diagram
ENV PUPPETEER_CACHE_DIR="/usr/local/share/puppeteer/cache" \
PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
COPY src/diagram.lua.patch /usr/local/src/autodoc/diagram.lua.patch
RUN set -ex; \
\
apk add --no-cache \
chromium \
npm \
patch \
; \
\
npm install --global @mermaid-js/mermaid-cli; \
# rm -rf /root/.cache/puppeteer; \
\
wget \
--output-document='/usr/local/share/pandoc/filters/diagram.lua' \
'https://raw.githubusercontent.com/pandoc-ext/diagram/refs/heads/main/_extensions/diagram/diagram.lua' \
; \
patch /usr/local/share/pandoc/filters/diagram.lua < /usr/local/src/autodoc/diagram.lua.patch; \
rm /usr/local/src/autodoc/diagram.lua.patch;