FROM golang:1.25-alpine AS builder

WORKDIR /app

COPY go.* ./
RUN go mod download || true

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -o pecker .

FROM alpine:latest

RUN apk --no-cache add ca-certificates

WORKDIR /root/

COPY --from=builder /app/pecker .

CMD ["./pecker"]

