Fix GOARCH: build arm64 binaries to match Docker platform

The Go build was targeting amd64 while docker-compose sets
platform: linux/arm64, causing SIGSEGV on startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-19 15:57:41 -06:00
parent 9916003bcd
commit ebbbe52560

View File

@@ -34,10 +34,10 @@ RUN go mod download
COPY . .
# Build the API binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /app/api ./cmd/api
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-w -s" -o /app/api ./cmd/api
# Build the worker binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /app/worker ./cmd/worker
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-w -s" -o /app/worker ./cmd/worker
# Base runtime stage for Go services
FROM alpine:3.19 AS go-base