FROM golang:1.24-alpine AS build

RUN apk update && apk add --no-cache git make build-base

WORKDIR /nagjo

RUN git clone https://codeberg.org/emersion/nagjo.git .

RUN go build

FROM alpine:latest

COPY --from=build /nagjo/nagjo /usr/bin/nagjo

CMD ["/usr/bin/nagjo", "-config", "/etc/nagjo/config.scfg" ]