| |
| |
| |
| FROM golang:1.26-alpine AS builder |
|
|
| |
| RUN apk add --no-cache git openssh-client |
|
|
| WORKDIR /build |
|
|
| |
| |
| RUN --mount=type=secret,id=GH_TOKEN \ |
| GH_TOKEN_VAL=$(cat /run/secrets/GH_TOKEN) && \ |
| if [ -z "$GH_TOKEN_VAL" ]; then echo "❌ 错误:Hugging Face 的 GH_TOKEN 读取失败,请检查 Settings 里的 Secret 命名是否完全一致!" && exit 1; fi && \ |
| git clone https://${GH_TOKEN_VAL}@github.com/jjf1126/Agent-Platform-Studio.git . |
|
|
| |
| RUN go mod download && \ |
| CGO_ENABLED=0 go build -buildvcs=false -trimpath -ldflags="-s -w" -o vproxy ./cmd/vproxy \ |
| && go clean -cache -modcache -testcache |
|
|
| |
| |
| |
| FROM alpine:3.20 |
|
|
| RUN apk add --no-cache ca-certificates tzdata bash |
|
|
| WORKDIR /app |
|
|
| |
| COPY --from=builder /build/vproxy /app/vproxy |
|
|
| |
| COPY --from=builder /build/config/ /app/config/ |
|
|
| |
| ENV VPROXY_CONFIG=/app/config/config.json |
| ENV VPROXY_API_KEYS=/app/config/api_keys.txt |
| ENV VPROXY_MODELS=/app/config/models.json |
|
|
| |
| ENV PORT=7860 |
| EXPOSE 7860 |
|
|
| |
| CMD ["./vproxy"] |