FROM golang:1.18 as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN ./build.sh
FROM scratch
COPY --from=builder /app/dist/imap-json-fetcher /imap-json-fetcher
ENTRYPOINT ["/imap-json-fetcher"]
