gb2a / Dockerfile
exable324's picture
Update Dockerfile
c95c235 verified
Raw History Blame Contribute Delete
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"]