diff --git a/Dockerfile b/Dockerfile index b80746bb..b4e9d427 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ # syntax=docker/dockerfile:1.7 -FROM oven/bun:1.3.14-alpine AS manifests +# The web bundle and self-hosted server are plain JavaScript. Build them on the +# runner's own architecture. QEMU arm64 hangs in Vite until the publish job hits +# its timeout. The runtime image below still follows the target architecture. +FROM --platform=$BUILDPLATFORM oven/bun:1.3.14-alpine AS manifests WORKDIR /app COPY package.json bun.lock bunfig.toml ./ diff --git a/scripts/docker-release.test.mjs b/scripts/docker-release.test.mjs index b1d59bc0..de458113 100644 --- a/scripts/docker-release.test.mjs +++ b/scripts/docker-release.test.mjs @@ -58,6 +58,7 @@ describe("Docker release contract", () => { dockerfile.indexOf("FROM oven/bun:1.3.14-alpine AS runtime"), ); const packageMetadata = JSON.parse(readProjectFile("package.json")); + expect(dockerfile).toContain("FROM --platform=$BUILDPLATFORM oven/bun:1.3.14-alpine AS manifests"); expect(dockerfile).toContain("FROM oven/bun:1.3.14-alpine AS runtime"); expect(dockerfile).toContain("COPY patches patches"); expect(dockerfile).toContain("COPY docs docs");