# Build stage
FROM golang:1.22-bullseye AS builder
WORKDIR /app
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o blackbox

# Run stage
FROM gcr.io/distroless/base-debian12
WORKDIR /app
COPY --from=builder /app/blackbox /app/blackbox
EXPOSE 3000
ENTRYPOINT ["/app/blackbox"]
