Spaces:
Paused
Paused
Download Dockerfile from Ethscriptions/tz: direct link, hf CLI and curl.
- Browser
- Download file 642 Bytes
-
https://huggingface.co/spaces/Ethscriptions/tz/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Ethscriptions/tz/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Ethscriptions/tz/resolve/main/Dockerfile
642 Bytes
| # 第一阶段:构建环境 | |
| FROM golang:1.21-alpine AS builder | |
| WORKDIR /app | |
| # 复制所有文件 | |
| COPY . . | |
| # 编译可执行文件 | |
| RUN go build -o go-wxpush main.go | |
| # 第二阶段:运行环境 | |
| FROM alpine:latest | |
| WORKDIR /app | |
| # 安装时区数据和基础证书(微信 API 需要 HTTPS) | |
| RUN apk --no-cache add ca-certificates tzdata | |
| # 从构建阶段复制二进制文件 | |
| COPY --from=builder /app/go-wxpush . | |
| # Hugging Face Spaces 默认使用 7860 端口 | |
| EXPOSE 7860 | |
| # 启动命令:将端口固定为 7860 | |
| # 注意:命令行参数可以通过 HF 的环境变量或在此处指定 | |
| ENTRYPOINT ["./go-wxpush"] | |
| CMD ["-port", "7860"] |