Spaces:
Paused
Paused
Download Dockerfile from sarkyboy/client2api: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/sarkyboy/client2api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/sarkyboy/client2api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/sarkyboy/client2api/resolve/main/Dockerfile
1.08 kB
| # Build stage | |
| FROM golang:1.26-alpine AS builder | |
| WORKDIR /app | |
| # Install git and patch | |
| RUN apk add --no-cache git patch | |
| # Clone the upstream repository | |
| RUN git clone https://github.com/Router-for-me/CLIProxyAPI . | |
| # Copy and apply the verification fix patch | |
| COPY auth_fix.patch . | |
| RUN patch -p1 < auth_fix.patch | |
| # Download dependencies | |
| RUN go mod download | |
| # Build the application | |
| RUN go build -o CLIProxyAPI cmd/server/main.go | |
| # Final stage | |
| FROM alpine:latest | |
| WORKDIR /CLIProxyAPI | |
| # Copy binary and config from builder | |
| COPY --from=builder /app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI | |
| COPY --from=builder /app/config.example.yaml /CLIProxyAPI/config.example.yaml | |
| # Copy local config and entrypoint | |
| COPY config.yaml /CLIProxyAPI/config.yaml | |
| COPY entrypoint.sh /CLIProxyAPI/entrypoint.sh | |
| # Create necessary directories and set permissions | |
| RUN mkdir -p /CLIProxyAPI/auth /CLIProxyAPI/logs && \ | |
| chmod 777 /CLIProxyAPI/auth /CLIProxyAPI/logs && \ | |
| chmod +x /CLIProxyAPI/entrypoint.sh | |
| # Expose port | |
| EXPOSE 8080 | |
| # Set entrypoint | |
| ENTRYPOINT ["/CLIProxyAPI/entrypoint.sh"] |