Files
tenant-registry/Dockerfile
T
Sharang ParnerkarandClaude Fable 5 6cd87ad31f
ci / shared (pull_request) Successful in 18s
ci / test (pull_request) Successful in 22m28s
ci / image (pull_request) Skipped
fix(build): builder image Go 1.25, go.mod requires >= 1.25.0
The image job now actually builds (docker:27-cli fix) and surfaced this:
golang:1.24-alpine ships go 1.24.13 with GOTOOLCHAIN=local, so
'go mod download' refuses the go 1.25.0 module (run 5490).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CNdLL9BdsWm7MCyui5ffPD
2026-08-31 18:58:04 +02:00

21 lines
712 B
Docker

# Multi-stage build for tenant-registry.
# Produces two binaries:
# /tenant-registry — long-running API server
# /migrate — one-shot schema migrator (Orca init container in prod)
FROM golang:1.25-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/tenant-registry ./cmd/server && \
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /out/migrate ./cmd/migrate
FROM gcr.io/distroless/static-debian12:nonroot
WORKDIR /
COPY --from=build /out/tenant-registry /tenant-registry
COPY --from=build /out/migrate /migrate
USER nonroot:nonroot
EXPOSE 8090
ENTRYPOINT ["/tenant-registry"]