FROM golang:1.22 as builder WORKDIR /app COPY go.mod ./ COPY go.sum ./ RUN --mount=type=cache,mode=0777,target=/go/pkg/mod go mod download all COPY ./cmd ./cmd COPY ./src ./src RUN --mount=type=cache,mode=0777,target=/go/pkg/mod CGO_ENABLED=0 go build -tags timetzdata -o /konfachcloud-discord-bot ./cmd/bot/main.go FROM scratch COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /konfachcloud-discord-bot /konfachcloud-discord-bot ENTRYPOINT ["/konfachcloud-discord-bot"]