MosswartOverlord/go-services/inventory-go/Dockerfile
Erik 7155055072 feat(suitbuilder): CD-tier filter helpers + tests; gate inventory-go build on go test
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 20:35:20 +02:00

13 lines
384 B
Docker

FROM golang:1.25-bookworm AS build
WORKDIR /src
COPY . .
RUN go mod tidy
RUN go test ./...
ARG BUILD_VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath -ldflags "-s -w -X main.buildVersion=${BUILD_VERSION}" -o /out/inventory-go .
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/inventory-go /inventory-go
EXPOSE 8772
ENTRYPOINT ["/inventory-go"]