Skip to content

Commit

Permalink
Upgrade to Alpine 3.18 (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie authored Jun 14, 2023
1 parent f8a0d82 commit 26de4e9
Show file tree
Hide file tree
Showing 17 changed files with 5,563 additions and 19,992 deletions.
2 changes: 1 addition & 1 deletion blockdiag/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.0-alpine3.16
FROM python:3.11.4-alpine3.18

RUN addgroup -g 1000 kroki && adduser -D -G kroki -u 1000 kroki

Expand Down
2 changes: 1 addition & 1 deletion blockdiag/src/backend/diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def generate_diag(app, diagram_type, output_format, source, options):

app.options.font = [
'/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf',
'/usr/share/fonts/ttf-dejavu/DejaVuSerif.ttf'
'/usr/share/fonts/dejavu/DejaVuSerif.ttf',
]

app.fontmap = create_fontmap(app.options)
Expand Down
48 changes: 17 additions & 31 deletions bpmn/Dockerfile
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"]
4 changes: 2 additions & 2 deletions bpmn/assets/bpmn-viewer.production.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 26de4e9

Please sign in to comment.