mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2026-11-04 08:59:08 +00:00
The multi-platform Docker build ran pnpm install and pnpm build for
linux/arm64 under QEMU emulation. QEMU intermittently crashes there
("qemu: uncaught target signal 4 (Illegal instruction)") or stalls, and
buildkit then waits until GitHub cancels the job at 6 hours: 16
cancelled runs in September, including a develop push.
The build output is a static site, identical on every architecture, so
the node stages now run on $BUILDPLATFORM and only the nginx stage
(COPY only) is built per architecture. Also caps the job at 30 minutes
so any future hang fails fast.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.0 KiB
Docker
43 lines
1.0 KiB
Docker
# The build output is a static site, so build it once on the runner's native
|
|
# platform instead of under QEMU emulation; only the nginx stage below is
|
|
# per-architecture.
|
|
FROM --platform=$BUILDPLATFORM docker.io/library/node:24.16.0-alpine3.22 AS mermaid-live-editor-dependencies
|
|
|
|
RUN apk --no-cache add build-base git python3 && \
|
|
rm -rf /var/cache/apk/*
|
|
|
|
RUN corepack enable pnpm
|
|
|
|
WORKDIR /app
|
|
|
|
COPY ./package.json .
|
|
COPY ./pnpm-lock.yaml .
|
|
|
|
RUN pnpm install
|
|
|
|
FROM mermaid-live-editor-dependencies AS mermaid-live-editor-builder
|
|
|
|
ARG MERMAID_RENDERER_URL
|
|
ARG MERMAID_KROKI_RENDERER_URL
|
|
ARG MERMAID_ANALYTICS_URL
|
|
ARG MERMAID_DOMAIN
|
|
ARG MERMAID_IS_ENABLED_MERMAID_CHART_LINKS
|
|
ARG MERMAID_PRIVACY_POLICY_URL
|
|
ARG MERMAID_HIDE_PRIVACY_POLICY
|
|
ARG MERMAID_BASE_PATH
|
|
|
|
COPY . ./
|
|
|
|
RUN pnpm build
|
|
|
|
FROM mermaid-live-editor-builder AS mermaid-dev
|
|
|
|
ENTRYPOINT ["pnpm", "dev"]
|
|
|
|
FROM nginx:1.28-alpine3.21 AS mermaid
|
|
|
|
EXPOSE 8080
|
|
|
|
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=mermaid-live-editor-builder /app/docs /usr/share/nginx/html
|