Add MQTT presence to Redis integration

This commit is contained in:
2026-02-02 12:35:38 +07:00
parent e1ceb88ba5
commit af21216d4c
5 changed files with 195 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# syntax=docker/dockerfile:1
# Build stage
FROM golang:1.22-alpine AS builder
WORKDIR /app
# Copy go mod files and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the rest of the application
COPY . .
# Build the application
RUN go build -o mqtt_presence_redis_go mqtt_presence_redis_go.go
# Runtime stage
FROM alpine:3.20
WORKDIR /app
COPY --from=builder /app/mqtt_presence_redis_go .
# Expose default MQTT port if needed
EXPOSE 1883
# Command to run the binary
CMD ["./mqtt_presence_redis_go"]