-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8a0d82
commit 26de4e9
Showing
17 changed files
with
5,563 additions
and
19,992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,28 @@ | ||
# Package the Node.js project into a single binary | ||
FROM --platform=$BUILDPLATFORM node:16.18.1-alpine3.16 as builder | ||
FROM node:18.16-alpine3.18 | ||
|
||
# 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 addgroup -g 1001 kroki && adduser -D -G kroki -u 1001 kroki | ||
|
||
RUN npm install -g [email protected] [email protected] | ||
RUN apk add --quiet --no-cache --update \ | ||
chromium \ | ||
font-noto-cjk | ||
|
||
ARG TARGETARCH | ||
ENV NODE node16 | ||
ENV PLATFORM alpine | ||
RUN /usr/local/bin/pkg-fetch -n $NODE -p $PLATFORM -a $([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") | ||
|
||
COPY package.json package-lock.json /app/ | ||
COPY src /app/src | ||
WORKDIR /app | ||
|
||
RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm ci --target_arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") --target_platform=$PLATFORM | ||
RUN npm run lint | ||
|
||
RUN /usr/local/bin/pkg --targets $NODE-$PLATFORM-$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") . -o app.bin | ||
|
||
# Create the image | ||
FROM alpine:3.16.3 | ||
USER kroki | ||
WORKDIR /usr/local/kroki/ | ||
|
||
RUN addgroup -g 1000 kroki && adduser -D -G kroki -u 1000 kroki | ||
RUN mkdir -p /usr/local/kroki/node && chown kroki:kroki -R /usr/local/kroki | ||
|
||
RUN apk add --quiet --no-cache --update chromium | ||
ENV KROKI_EXCALIDRAW_PAGE_URL=file:///usr/local/kroki/assets/index.html | ||
ENV PUPPETEER_EXECUTABLE_PATH=/usr/lib/chromium/chrome | ||
#ENV DEBUG="puppeteer:*" | ||
ENV LEVEL="info" | ||
|
||
COPY --from=builder /app/app.bin /usr/bin/bpmn | ||
COPY --chown=kroki:kroki assets /usr/local/kroki/assets | ||
COPY --chown=kroki:kroki src ./src | ||
COPY --chown=kroki:kroki package*.json ./ | ||
COPY --chown=kroki:kroki assets ./assets | ||
|
||
ENV KROKI_BPMN_PAGE_URL=file:///usr/local/kroki/assets/index.html | ||
ENV PUPPETEER_EXECUTABLE_PATH=/usr/lib/chromium/chrome | ||
RUN npm i --omit=dev | ||
|
||
EXPOSE 8003 | ||
|
||
USER kroki | ||
ENTRYPOINT ["node", "src/index.js"] | ||
|
||
ENTRYPOINT ["/usr/bin/bpmn"] |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.