Nik Afiq 5f0ae449b2
All checks were successful
CI / test (push) Successful in 4s
CI / build-ha-gateway (push) Successful in 55s
CI / build-discord-bot (push) Successful in 43s
feat: add .dockerignore file and update Dockerfile to include discord-bot directory
2026-04-06 20:49:51 +09:00

21 lines
474 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/ha-gateway
RUN go mod download
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags="-s -w -X main.version=${VERSION}" \
-o /ha-gateway ./cmd/gateway
FROM gcr.io/distroless/static:nonroot
COPY --from=builder /ha-gateway /ha-gateway
EXPOSE 50051
ENTRYPOINT ["/ha-gateway"]