Self-hosted fitness tracker. Log workouts, track nutrition, and monitor progress. Docker deployment, mobile-friendly.
Speed up multi-arch builds: cross-compile instead of QEMU emulation
Cawlumm302b94b151b4
diff --git a/backend/Dockerfile b/backend/Dockerfileindex 1823840..865e1b2 100644--- a/backend/Dockerfile+++ b/backend/Dockerfile@@ -1,5 +1,8 @@-# Stage 1: Build-FROM golang:1.26-alpine AS builder+# Stage 1: Build — run on host platform, cross-compile to target+FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder++ARG TARGETOS+ARG TARGETARCHWORKDIR /build@@ -9,7 +12,7 @@ RUN go mod download# Copy source and build a statically linked binaryCOPY . .-RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o lyftr-api .+RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags="-s -w" -o lyftr-api .# Stage 2: RuntimeFROM alpine:3.19diff --git a/web/Dockerfile b/web/Dockerfileindex 154feeb..19e2571 100644--- a/web/Dockerfile+++ b/web/Dockerfile@@ -1,5 +1,5 @@-# Stage 1: Build-FROM node:20-alpine AS builder+# Stage 1: Build — run on host platform to avoid QEMU slowness for npm/node+FROM --platform=$BUILDPLATFORM node:20-alpine AS builderWORKDIR /app