All checks were successful
CI / build-tts-sidecar (push) Has been skipped
CI / changes (push) Successful in 7s
CI / test (push) Successful in 6s
CI / build-ai-gateway (push) Successful in 1m10s
CI / build-ha-gateway (push) Successful in 52s
CI / build-discord-bot (push) Successful in 53s
CI / build-tts-gateway (push) Successful in 5m25s
- Updated CI workflow to run `go vet` and `go test` for all modules on every push/PR. - Implemented a `changes` job to rebuild only affected Docker images based on modified paths. - Introduced caching for Docker builds to speed up subsequent runs by leveraging registry-based cache. - Modified Dockerfiles for `ai-gateway`, `discord-bot`, `ha-gateway`, and `tts-gateway` to copy `go.mod` and `go.sum` files first, allowing for better caching of dependencies. - Added `go.sum` file for `tts-gateway` to ensure proper dependency management. - Ensured that `go mod download` is executed in the correct order to optimize layer caching.
34 lines
1002 B
Docker
34 lines
1002 B
Docker
FROM golang:1.26-alpine AS builder
|
|
WORKDIR /workspace
|
|
|
|
COPY go.work go.work.sum ./
|
|
|
|
# Manifests only, copied first, so `go mod download` gets its own cache layer
|
|
# invalidated only by dependency changes - not by every source edit below.
|
|
COPY gen/go.mod gen/go.sum ./gen/
|
|
COPY ai-gateway/go.mod ai-gateway/go.sum ./ai-gateway/
|
|
COPY discord-bot/go.mod discord-bot/go.sum ./discord-bot/
|
|
COPY tts-gateway/go.mod tts-gateway/go.sum ./tts-gateway/
|
|
COPY ha-gateway/go.mod ha-gateway/go.sum ./ha-gateway/
|
|
|
|
WORKDIR /workspace/ha-gateway
|
|
RUN go mod download
|
|
|
|
WORKDIR /workspace
|
|
COPY gen/ ./gen/
|
|
COPY ai-gateway/ ./ai-gateway/
|
|
COPY discord-bot/ ./discord-bot/
|
|
COPY tts-gateway/ ./tts-gateway/
|
|
COPY ha-gateway/ ./ha-gateway/
|
|
|
|
WORKDIR /workspace/ha-gateway
|
|
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"]
|