Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Fix multi-arch web image build: pin builder stage to native platform

Duarte Santos17cad3fa3add
diff --git a/web/Dockerfile b/web/Dockerfile
index ed08f2892..9b30e63a9 100644
--- a/web/Dockerfile
+++ b/web/Dockerfile
@@ -1,6 +1,13 @@
# Multi-stage: build the React app, then serve it with nginx.
# Self-hosters never need Node locally — `docker compose up` builds everything.
-FROM node:22-alpine AS build
+#
+# --platform=$BUILDPLATFORM pins the build stage to the host's native arch even when
+# cross-building for other targets (e.g. amd64 host building an arm64 image). The build
+# output (static JS/CSS/HTML) is arch-independent, so there's no reason to run it under
+# QEMU — and QEMU-emulated npm installs are known to corrupt esbuild/rollup's platform-
+# specific native binaries, which is what breaks `vite build` with unrelated-looking
+# module-resolution errors.
+FROM --platform=$BUILDPLATFORM node:22-alpine AS build
WORKDIR /app
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm ci 2>/dev/null || npm install