Download Dockerfile from exable324/gb2a: direct link, hf CLI and curl.
- Browser
- Download file 822 Bytes
-
https://huggingface.co/spaces/exable324/gb2a/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/exable324/gb2a/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/exable324/gb2a/resolve/main/Dockerfile
822 Bytes
| FROM ghcr.io/chenyme/grok2api:latest | |
| USER root | |
| RUN mkdir -p /app/data/media && chown -R 1000:1000 /app | |
| # [核心修复 1] 必须安装 curl。这里做了兼容处理(无论镜像是基于 Debian 还是 Alpine 都能装上) | |
| RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/* || \ | |
| (apk update && apk add --no-cache curl ca-certificates) | |
| USER 1000 | |
| # 注意:请确保你的配置文件名是 config.yaml(而不是 config.yml) | |
| COPY --chown=1000:1000 config.yaml /app/config.yaml | |
| COPY --chown=1000:1000 start.sh /app/start.sh | |
| # [核心修复 2] 转换 Windows CRLF 为 Linux LF,防止脚本无法执行,并赋予权限 | |
| RUN sed -i 's/\r$//' /app/start.sh && chmod +x /app/start.sh | |
| EXPOSE 7860 | |
| ENTRYPOINT [] | |
| # 运行自定义的启动脚本 | |
| CMD ["/app/start.sh"] |