# Multi-stage build for the Go discord-rare-monitor port. The unit test (rare # classification) runs at build time, so a classifier regression fails the build. 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" -o /out/discord-go . # distroless/static includes CA certificates (needed for Discord's HTTPS REST API). FROM gcr.io/distroless/static-debian12:nonroot COPY --from=build /out/discord-go /discord-go ENTRYPOINT ["/discord-go"]