# Build a small static binary, then run it from a minimal base image.
FROM golang:1.22-alpine AS build
WORKDIR /src
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /bin/beacon .

FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/beacon /bin/beacon
EXPOSE 8080
ENTRYPOINT ["/bin/beacon"]
