From 10c8baddaefaf066d7d6a98c21c4e04e3be5d07f Mon Sep 17 00:00:00 2001 From: Philipp Hertweck Date: Fri, 29 Jul 2022 10:56:30 +0200 Subject: [PATCH] Install mmdc, to allow the rendering of mermaid diagrams --- alpine/Dockerfile | 12 ++++++++++++ alpine/mmdc | 2 ++ alpine/puppeteer-config.json | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100755 alpine/mmdc create mode 100644 alpine/puppeteer-config.json diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 914906a..566eb65 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -25,6 +25,18 @@ RUN gem install pygments.rb #RUN apk add --no-cache cmark --repository http://nl.alpinelinux.org/alpine/edge/testing && \ # apk add --no-cache --allow-untrusted pandoc --repository https://conoria.gitlab.io/alpine-pandoc/ +# Add mermaid +ENV CHROME_BIN="/usr/bin/chromium-browser" \ + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true" +RUN apk add --no-cache npm && \ + # Dependencies for running puppeteer + apk add --no-cache chromium terminus-font ttf-dejavu ttf-freefont ttf-inconsolata ttf-linux-libertine && \ + fc-cache -f && \ + npm install @mermaid-js/mermaid-cli +ADD puppeteer-config.json /puppeteer-config.json +ADD mmdc /usr/local/bin/mmdc +RUN chmod +x /usr/local/bin/mmdc + SHELL ["/bin/bash", "-c"] USER dtcuser diff --git a/alpine/mmdc b/alpine/mmdc new file mode 100755 index 0000000..2b7409a --- /dev/null +++ b/alpine/mmdc @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +/node_modules/.bin/mmdc -p /puppeteer-config.json "$@" \ No newline at end of file diff --git a/alpine/puppeteer-config.json b/alpine/puppeteer-config.json new file mode 100644 index 0000000..7c7312f --- /dev/null +++ b/alpine/puppeteer-config.json @@ -0,0 +1,6 @@ +{ + "executablePath": "/usr/bin/chromium-browser", + "args": [ + "--no-sandbox" + ] +} \ No newline at end of file