Download Dockerfile from colleryu/gobing: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/spaces/colleryu/gobing/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/colleryu/gobing/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/colleryu/gobing/resolve/main/Dockerfile
1.04 kB
| # Build Stage | |
| # 使用 golang:alpine 作为构建阶段的基础镜像 | |
| FROM golang:alpine AS builder | |
| # 添加 git,并且清除缓存🧹 | |
| RUN apk --no-cache add git && \ | |
| git clone https://github.com/Harry-zklcdc/go-proxy-bingai.git /workspace/app && \ | |
| apk del git | |
| # 设置工作目录 | |
| WORKDIR /workspace/app | |
| # 编译 go 项目 | |
| RUN go build -ldflags="-s -w" -tags netgo -trimpath -o go-proxy-bingai main.go | |
| # Runtime Stage | |
| # 使用轻量级的 alpine 镜像🪞 | |
| FROM alpine | |
| # 设置工作目录💼 | |
| WORKDIR /workspace/app | |
| # 从构建阶段复制编译后的二进制文件👔 | |
| COPY --from=builder /workspace/app/go-proxy-bingai . | |
| # (可选)设置环境变量✍️ | |
| ENV Go_Proxy_BingAI_USER_TOKEN_1="1pjaHoJCilUXJ-xrKNi1Css7d_xTQuFEGY26S8zdoUoaSyRu_H2VpmhdkSi7bYgQeH6UoJuimXoocHzmHQr67FHRnC5_GHOBzWmARN-J5Ln6TBhfDpp0s6OTUhdsPcmPM-KgtEfH4Syb2ZMlViOXn84D6RQA_oNq8Ot0tco_l6fSWpvrHh-l85kWRV3fiCEpap3ioR4eQpwhlZsW4n283pYlXIiRAYxtjVUTYUBpXwVE" | |
| # 端口 | |
| EXPOSE 8080 | |
| # 容器运行✅ | |
| CMD ["/workspace/app/go-proxy-bingai"] | |