- Added command handler for processing Discord interactions related to lights and switches. - Implemented command registration for light control commands: list, on, off, and toggle. - Created a gRPC client for communicating with the home automation gateway. - Developed application logic for handling light and switch commands, including listing, turning on/off, and toggling lights. - Introduced telemetry setup for OpenTelemetry integration. - Added configuration loading for Discord token, gateway address, and OpenTelemetry endpoint. - Defined core driven ports for interacting with the home automation gateway.
20 lines
462 B
Docker
20 lines
462 B
Docker
FROM golang:1.26-alpine AS builder
|
|
WORKDIR /workspace
|
|
|
|
COPY go.work go.work.sum ./
|
|
COPY gen/ ./gen/
|
|
COPY ha-gateway/ ./ha-gateway/
|
|
COPY discord-bot/ ./discord-bot/
|
|
|
|
WORKDIR /workspace/discord-bot
|
|
RUN go mod download
|
|
|
|
ARG VERSION=dev
|
|
RUN CGO_ENABLED=0 GOOS=linux go build \
|
|
-ldflags="-s -w -X main.version=${VERSION}" \
|
|
-o /discord-bot ./cmd/bot
|
|
|
|
FROM gcr.io/distroless/static:nonroot
|
|
COPY --from=builder /discord-bot /discord-bot
|
|
ENTRYPOINT ["/discord-bot"]
|