FROM golang:1.21-alpine AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /sourcewatch .

FROM alpine:3.19
RUN apk add --no-cache ca-certificates
COPY --from=builder /sourcewatch /usr/local/bin/sourcewatch
ENTRYPOINT ["sourcewatch"]
