Spaces:
Paused
Paused
Download Dockerfile from maker-mullin/llmtest: direct link, hf CLI and curl.
- Browser
- Download file 938 Bytes
-
https://huggingface.co/spaces/maker-mullin/llmtest/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/maker-mullin/llmtest/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/maker-mullin/llmtest/resolve/main/Dockerfile
938 Bytes
| # =============================================== | |
| # Dockerfile - Go 高性能版本 | |
| # =============================================== | |
| # | |
| # 构建方式: | |
| # docker build -t llmtest:go . | |
| # | |
| # 运行方式: | |
| # docker run -p 7860:7860 -e UUID=your-uuid llmtest:go | |
| # | |
| # =============================================== | |
| # ============ 阶段 1: Go 编译阶段 ============ | |
| FROM golang:1.21-alpine AS builder | |
| WORKDIR /build | |
| # 复制 Go 源码 | |
| COPY main.go go.mod ./ | |
| # 编译静态二进制文件 | |
| RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w -s' -o app main.go | |
| # ============ 阶段 2: 运行阶段 ============ | |
| FROM alpine:latest | |
| WORKDIR /app | |
| # 从构建阶段复制编译好的二进制文件 | |
| COPY --from=builder /build/app /app/app | |
| COPY xray.zip /app/xray.zip | |
| # 安装 unzip | |
| RUN apk add --no-cache unzip | |
| # 环境变量 | |
| ENV PORT=7860 | |
| ENV UUID=21447b8e-50c2-4d20-a19e-e3361ad57123 | |
| EXPOSE 7860 | |
| CMD ["/app/app"] | |