diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..df13c61 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:1.24-alpine AS builder + +WORKDIR /build +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o proxx + +FROM alpine:3.21 + +RUN apk add --no-cache ca-certificates +COPY --from=builder /build/proxx /usr/local/bin/proxx +COPY --from=builder /build/config.yaml /etc/proxx/config.yaml + +EXPOSE 8080 +ENTRYPOINT ["proxx"] diff --git a/README.md b/README.md index 8ff6153..d72b55a 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ Create a `config.yaml` file in the working directory: port: 8080 upstream_url: "https://api.z.ai/api/anthropic" +# Optional: override temperature for all requests +# temperature: 0.7 + # Retry configuration max_retries: 3 retry_base_delay_ms: 1000 @@ -70,6 +73,8 @@ Provides Go toolchain with gopls and other development tools. ## Running +### Binary + ```bash ./proxx ``` @@ -79,6 +84,18 @@ The server will start and log: Starting proxx on :8080, upstream: https://api.z.ai/api/anthropic ``` +### Docker + +```bash +docker build -t proxx . +docker run -p 8080:8080 -v ./config.yaml:/etc/proxx/config.yaml proxx +``` + +The server will start and log: +``` +Starting proxx on :8080, upstream: https://api.z.ai/api/anthropic +``` + ## API Endpoints ### GET /v1/models @@ -230,4 +247,4 @@ proxx/ ## License -See LICENSE file for details. +MIT