uncloseai.com/languages/go/openai/Dockerfile

26 lines
598 B
Docker

# Multi-stage build for Go with official OpenAI SDK
FROM golang:1.22-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"]