Files
chat-handler/Dockerfile
Billy D. 4175e2070c
Some checks failed
CI / Lint (pull_request) Failing after 58s
CI / Test (pull_request) Failing after 1m22s
CI / Notify (pull_request) Successful in 1s
CI / Release (pull_request) Has been skipped
CI / Docker Build & Push (pull_request) Has been skipped
feat: migrate to typed messages, drop base64
- Switch OnMessage → OnTypedMessage with natsutil.Decode[messages.ChatRequest]
- Return *messages.ChatResponse / *messages.ChatStreamChunk (not map[string]any)
- Audio as raw []byte in msgpack (25% wire savings vs base64)
- Remove strVal/boolVal/intVal helpers
- Add .dockerignore, GOAMD64=v3 in Dockerfile
- Update tests for typed structs (9 tests pass)
2026-02-20 07:10:43 -05:00

24 lines
440 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 GOAMD64=v3 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"]