Deploy MQTT test backend with private viewer and Gitea CI/CD
Test and deploy MQTT backend / test (push) Successful in 2m8s
Test and deploy MQTT backend / deploy (push) Successful in 18s

This commit is contained in:
2026-10-08 14:48:53 +03:30
commit 71ef622b4f
70 changed files with 7123 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM golang:1.27.1-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/test-mqtt5 ./cmd/test-mqtt5 \
&& CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/device-sim ./cmd/device-sim
FROM build AS test
RUN go test ./... && go vet ./...
FROM alpine:3.22
RUN addgroup -S -g 10001 app && adduser -S -D -H -u 10001 -G app app \
&& apk add --no-cache ca-certificates
COPY --from=build /out/test-mqtt5 /test-mqtt5
COPY --from=build /out/device-sim /device-sim
USER app:app
ENTRYPOINT ["/test-mqtt5"]