Files
tts-module/Dockerfile
Billy D. 85b481b6c4
Some checks failed
CI / Lint (pull_request) Failing after 1m1s
CI / Test (pull_request) Failing after 1m21s
CI / Release (pull_request) Has been skipped
CI / Docker Build & Push (pull_request) Has been skipped
CI / Notify (pull_request) Successful in 1s
feat: migrate to typed messages, drop base64
- Decode TTSRequest via natsutil.Decode[messages.TTSRequest]
- Stream audio as raw bytes via messages.TTSAudioChunk (no base64)
- Non-stream response uses messages.TTSFullResponse
- Status updates use messages.TTSStatus
- Voice list/refresh use messages.TTSVoiceListResponse/TTSVoiceRefreshResponse
- Registry returns []messages.TTSVoiceInfo (not []map[string]any)
- Remove strVal/boolVal helpers
- Add .dockerignore, GOAMD64=v3 in Dockerfile
- Update tests for typed structs (13 tests pass)
2026-02-20 07:11:13 -05:00

32 lines
623 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install ca-certificates for HTTPS
RUN apk add --no-cache ca-certificates
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build static binary
RUN CGO_ENABLED=0 GOOS=linux GOAMD64=v3 go build -ldflags="-w -s" -o /tts-module .
# Runtime stage - scratch for minimal image
FROM scratch
# Copy CA certificates for HTTPS
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy binary
COPY --from=builder /tts-module /tts-module
# Run as non-root
USER 65534:65534
ENTRYPOINT ["/tts-module"]