Add initial MQTT scrubber service scaffold

This commit is contained in:
2026-03-12 18:12:16 +01:00
parent 957b2c41b3
commit 464f4c3ec4
22 changed files with 4150 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
FROM golang:1.24-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/mqqt-scrubber ./cmd/mqqt-scrubber
FROM alpine:3.20
RUN addgroup -S app && adduser -S -G app app \
&& apk add --no-cache ca-certificates wget
WORKDIR /app
COPY --from=build /out/mqqt-scrubber /usr/local/bin/mqqt-scrubber
COPY config.example.json /app/config.json
USER app
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 CMD wget -q -O- http://127.0.0.1:8080/healthz >/dev/null || exit 1
ENTRYPOINT ["/usr/local/bin/mqqt-scrubber"]
CMD ["-config", "/app/config.json"]