Skip to content

Instantly share code, notes, and snippets.

@madmas
Created April 9, 2024 15:40
Show Gist options
  • Save madmas/f42300f1056aa9cce1e0485c2077b46e to your computer and use it in GitHub Desktop.
Save madmas/f42300f1056aa9cce1e0485c2077b46e to your computer and use it in GitHub Desktop.
kroki / mermaid image based on pupeteer:latest
FROM ghcr.io/puppeteer/puppeteer:latest
USER root
RUN addgroup -gid 1001 kroki
RUN useradd -g kroki --uid 1001 kroki
RUN apt-get update
RUN apt-get install \
fonts-noto-cjk
RUN apt-get clean
RUN mkdir -p /usr/share/fonts/truetype/google-fonts
COPY --chown=kroki:kroki fonts /usr/share/fonts/truetype/google-fonts
RUN fc-cache -f && rm -rf /var/cache/*
RUN mkdir -p /home/kroki/node && chown kroki:kroki -R /home/kroki
USER kroki
WORKDIR /home/kroki/
ENV KROKI_MERMAID_PAGE_URL=file:///home/kroki/assets/index.html
ENV PUPPETEER_EXECUTABLE_PATH=/usr/lib/chromium/chrome
#ENV DEBUG="puppeteer:*"
ENV LEVEL="info"
COPY --chown=kroki:kroki src ./src
COPY --chown=kroki:kroki package*.json ./
COPY --chown=kroki:kroki assets ./assets
RUN npm i --omit=dev
EXPOSE 8002
ENTRYPOINT ["node", "src/index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment