Spaces:
Runtime error
Runtime error
Download Dockerfile from ZHZ1024/go-proxy-gemini-api: direct link, hf CLI and curl.
- Browser
- Download file 543 Bytes
-
https://huggingface.co/spaces/ZHZ1024/go-proxy-gemini-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ZHZ1024/go-proxy-gemini-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ZHZ1024/go-proxy-gemini-api/resolve/main/Dockerfile
543 Bytes
| # 构建阶段 | |
| FROM golang:1.21-alpine AS builder | |
| # 安装必要的构建工具 | |
| RUN apk add --no-cache git | |
| # 设置工作目录 | |
| WORKDIR /build | |
| # 复制源代码 | |
| COPY . . | |
| # 构建应用 | |
| RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gemini-relay . | |
| # 运行阶段 | |
| FROM alpine:latest | |
| # 安装ca证书,用于HTTPS请求 | |
| RUN apk --no-cache add ca-certificates | |
| WORKDIR /root/ | |
| # 从构建阶段复制二进制文件 | |
| COPY --from=builder /build/gemini-relay . | |
| # 暴露端口 | |
| EXPOSE 8080 | |
| # 运行应用 | |
| CMD ["./gemini-relay"] |