FROM golang:1.26-alpine AS build
WORKDIR /src
COPY shared/ shared/
COPY provisioning/go.mod provisioning/go.sum provisioning/
WORKDIR /src/provisioning
RUN go mod download
COPY provisioning/ .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /provisioning .

FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /provisioning /provisioning
EXPOSE 8084
USER 65534
ENTRYPOINT ["/provisioning"]
