Files
energy-meter/Dockerfile
Thomas Klaehn 066fa5ca51 Initial implementation: MQTT-based energy meter subscriber
Subscribes to Eastron SDM630 power meter data via MQTT broker,
decodes Modbus RTU frames, and writes readings to InfluxDB.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 08:01:17 +02:00

14 lines
362 B
Docker

FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN CGO_ENABLED=0 go build -o energy-mqtt-sub .
FROM alpine:3.21
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/energy-mqtt-sub .
USER nobody:nobody
ENTRYPOINT ["./energy-mqtt-sub", "-c", "/srv/energy/meter/config.json"]