Deploy MQTT test backend with private viewer and Gitea CI/CD
This commit is contained in:
+18
@@ -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"]
|
||||
Reference in New Issue
Block a user