# P2: dd0c/drift agent — Go binary
FROM golang:1.22-alpine AS builder
WORKDIR /app
COPY go.mod go.sum* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o dd0c-drift ./cmd/main.go

FROM alpine:3.20
RUN apk add --no-cache ca-certificates
COPY --from=builder /app/dd0c-drift /usr/local/bin/
ENTRYPOINT ["dd0c-drift"]
