Replace Python chat handler with Go for smaller container images. Uses handler-base Go module for NATS, health, telemetry, and service clients. - RAG pipeline: embed → Milvus → rerank → LLM - Streaming response chunks - Optional TTS synthesis - Custom response_subject support for companions-frontend
24 lines
429 B
Docker
24 lines
429 B
Docker
# Build stage
|
|
FROM golang:1.25-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /chat-handler .
|
|
|
|
# Runtime stage
|
|
FROM scratch
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
COPY --from=builder /chat-handler /chat-handler
|
|
|
|
USER 65534:65534
|
|
|
|
ENTRYPOINT ["/chat-handler"]
|