# PUBLIC DOMAIN - NO LICENSE, NO WARRANTY
# Copyright 2025 TimeHexOn & foxhop & russell@unturf
# https://www.permacomputer.com

# Multi-stage build for Go with official OpenAI SDK
FROM golang:1.23-alpine AS builder

WORKDIR /app

# Copy go mod files
COPY go.mod ./
RUN go get github.com/openai/openai-go/v3@v3.3.0

# Copy source code
COPY main.go ./

# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o /uncloseai main.go

# Final stage
FROM alpine:latest
WORKDIR /root/
COPY --from=builder /uncloseai ./

# Set environment variables for testing
ENV MODEL_ENDPOINT_1=https://hermes.ai.unturf.com
ENV MODEL_ENDPOINT_2=https://qwen.ai.unturf.com
ENV TTS_ENDPOINT_1=https://speech.ai.unturf.com

CMD ["./uncloseai"]
