-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
24 lines (19 loc) · 889 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM minlag/mermaid-cli:10.9.1 as base
ENV MERMAID_RENDERER=mermaid-cli \
MMDC_EXECUTABLE_PATH=/mmdc-wrapper
# Install java
USER root
RUN apk add --no-cache openjdk11-jre
# Create a wrapper. We need it in order to pass the puppeteer config on each call
RUN echo -e '#!/bin/ash\n/home/mermaidcli/node_modules/.bin/mmdc -p /puppeteer-config.json $@' > $MMDC_EXECUTABLE_PATH && \
chmod +x $MMDC_EXECUTABLE_PATH && chown mermaidcli $MMDC_EXECUTABLE_PATH
COPY build/libs/*no_local*.jar /docker-compose-viz-mermaid.jar
FROM base as test
# Test that it works as expected
USER mermaidcli
RUN echo -e "services:\n web:\n image: derlin/rickroller" > /tmp/dc.yaml && \
echo y | java -jar /docker-compose-viz-mermaid.jar /tmp/dc.yaml -f svg -o /tmp/dc.svg && \
rm /tmp/dc*
FROM base as final
ENTRYPOINT ["java", "-jar", "/docker-compose-viz-mermaid.jar"]
CMD [ "--help" ]