forked from mermaid-js/mermaid-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerfileBuild
33 lines (22 loc) · 792 Bytes
/
DockerfileBuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM node:18.20-alpine3.19 AS build
ENV CHROME_BIN="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_DOWNLOAD="true"
RUN apk add chromium
WORKDIR /app
COPY . /app/
RUN npm install \
&& npm pack
FROM node:18.20-alpine3.19 AS mermaid-cli-current
WORKDIR /app
COPY --from=build /app/*-mermaid-cli-*.tgz /install/
COPY --from=build /app/puppeteer-config.json /puppeteer-config.json
ADD install-dependencies.sh install-dependencies.sh
RUN chmod 755 install-dependencies.sh && /bin/sh install-dependencies.sh
RUN adduser -D mermaidcli
USER mermaidcli
WORKDIR /home/mermaidcli
RUN npm install $(ls -d /install/*.tgz)
ADD puppeteer-config.json /puppeteer-config.json
WORKDIR /data
ENTRYPOINT ["/home/mermaidcli/node_modules/.bin/mmdc", "-p", "/puppeteer-config.json"]
CMD [ "--help" ]