# Stage 1: Build UI FROM node:22-slim AS ui-builder WORKDIR /ui COPY ui/package.json ui/package-lock.json* ./ RUN npm ci --ignore-scripts COPY ui/ . RUN npm run build # Stage 2: Build Go binary FROM golang:1.23-alpine AS go-builder RUN apk add --no-cache git WORKDIR /src COPY go.mod go.sum ./ RUN go mod download COPY . . COPY --from=ui-builder /ui/dist ./ui/dist RUN CGO_ENABLED=0 go build -o /agent-mgr ./cmd/agent-mgr # Stage 3: Runtime FROM gcr.io/distroless/static-debian12:nonroot COPY --from=go-builder /agent-mgr /agent-mgr EXPOSE 8080 ENTRYPOINT ["/agent-mgr"]