Skip to content

Commit

Permalink
Add BPMN support
Browse files Browse the repository at this point in the history
add support to render BPMN diagram via bpmn-js
yuzutechGH-44
  • Loading branch information
nekator committed Apr 24, 2020
1 parent 5dbe1a2 commit ed983f8
Show file tree
Hide file tree
Showing 18 changed files with 2,838 additions and 15 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ buildDockerImages:
cd server && $(MAKE) package
cd blockdiag && $(MAKE) package
cd mermaid && $(MAKE) package
cd bpmn && $(MAKE) package

showExamples:
python blockdiag/examples.py
Expand All @@ -44,6 +45,7 @@ releaseDockerImages:
docker tag yuzutech/kroki:latest yuzutech/kroki:latest
docker tag yuzutech/kroki-blockdiag:latest yuzutech/kroki-blockdiag:latest
docker tag yuzutech/kroki-mermaid:latest yuzutech/kroki-mermaid:latest
docker tag yuzutech/kroki-bpmn:latest yuzutech/kroki-bpmn:latest

pushDockerImages:
docker push yuzutech/kroki:latest
Expand All @@ -52,6 +54,7 @@ pushDockerImages:
docker push yuzutech/kroki:$(LATEST_VERSION)
docker push yuzutech/kroki-blockdiag:$(LATEST_VERSION)
docker push yuzutech/kroki-mermaid:$(LATEST_VERSION)
docker push yuzutech/kroki-bpmn:$(LATEST_VERSION)

smokeTests:
@docker-compose --file "$(SMOKE_TESTS_DIR)/docker-compose.yaml" up --build --detach \
Expand Down
1 change: 1 addition & 0 deletions bpmn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
37 changes: 37 additions & 0 deletions bpmn/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Package the Node.js project into a single binary
FROM node:12.16.2-alpine3.11 as builder

# Workaround: https://github.com/nodejs/docker-node/issues/813#issuecomment-407339011
# Error: could not get uid/gid
# [ 'nobody', 0 ]
RUN npm config set unsafe-perm true

RUN npm install -g pkg pkg-fetch

ENV NODE node10
ENV PLATFORM alpine
ENV ARCH x64
RUN /usr/local/bin/pkg-fetch ${NODE} ${PLATFORM} ${ARCH}

WORKDIR /app

COPY package.json package-lock.json /app/
COPY src /app/src

RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm ci

RUN /usr/local/bin/pkg --targets ${NODE}-${PLATFORM}-${ARCH} . -o app.bin

# Create the image
FROM alpine:3.11.6

COPY --from=builder /app/app.bin /node/bin/bpmn
COPY assets /app/assets
ENV KROKI_MERMAID_PAGE_URL=file:///app/assets/index.html

RUN apk add --no-cache --update chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/lib/chromium/chrome

EXPOSE 8002

ENTRYPOINT ["/node/bin/bpmn"]
4 changes: 4 additions & 0 deletions bpmn/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default:

package:
docker build -t yuzutech/kroki-bpmn .
29 changes: 29 additions & 0 deletions bpmn/assets/bpmn-viewer.production.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions bpmn/assets/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<html>
<body>
<div id="container"></div>
<script src="./bpmn-viewer.production.min.js" charset="utf-8"></script>
</body>
</html>
Loading

0 comments on commit ed983f8

Please sign in to comment.