FROM golang:1.21-alpine as builder

RUN mkdir -p /go/src
WORKDIR /go/src
COPY ./src/ /go/src
RUN go build -a -installsuffix nocgo -o udi .


FROM scratch

ENV MQTT_BROKER ""
ENV MQTT_USERNAME ""
ENV MQTT_PASSWORD ""
ENV MQTT_ENABLE_TLS ""
ENV MQTT_SUBSCRIBE_TOPICS ""

COPY --from=builder /go/src/udi ./
ENTRYPOINT ["./udi"]


