fedcea06c7
go.mod requires >= 1.25.0; previous Dockerfile pinned 1.24 which failed at `go mod download` with: "go: go.mod requires go >= 1.25.0". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
21 lines
712 B
Docker
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"]
|