forked from mermaid-js/mermaid-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerfileBuild
35 lines (24 loc) · 840 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
34
35
FROM node:alpine AS build
ENV CHROME_BIN="/usr/bin/chromium-browser" \
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
RUN apk add chromium
WORKDIR /app
COPY . /app/
RUN yarn \
&& chmod 755 copy_modules.sh \
&& /bin/sh copy_modules.sh \
&& yarn prepublishOnly \
&& yarn pack
FROM node:alpine 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 yarn add $(ls -d /install/*.tgz)
ADD puppeteer-config.json /puppeteer-config.json
ENTRYPOINT ["./node_modules/.bin/mmdc", "-p", "/puppeteer-config.json"]
CMD [ "--help" ]