onebots / Dockerfile
liangcai's picture
Update Dockerfile
c492e78 verified
Raw
History Blame Contribute Delete
1.33 kB
# OneBots 网关 - 专用于 Hugging Face Spaces
# 基于官方镜像,仅增加 HF 要求的端口 7860 与入口脚本,无需在 HF 上从源码构建(无需 GH_PKG_TOKEN)
# 在 HF 创建 Space 时选择 Docker,将本文件命名为 Dockerfile 或通过 Build 设置指定
# 文档:https://huggingface.co/docs/hub/spaces-sdks-docker
# 持久化:与标准镜像相同,数据在 /data;可信域名校验文件可放在 /data/static(config 中 public_static_dir: static),并纳入 data_backup.tar.gz 备份
FROM ghcr.io/lc-cn/onebots:8aa3602
# 入口脚本需用 curl 从 Space 仓库拉取 data 备份,Alpine 默认无 curl
RUN apk add --no-cache curl
# Hugging Face Spaces 默认暴露 7860,由 PORT 环境变量传入
ENV PORT=7860
EXPOSE 7860
COPY docker-entrypoint-hf.sh /docker-entrypoint-hf.sh
RUN chmod +x /docker-entrypoint-hf.sh
ENTRYPOINT ["/docker-entrypoint-hf.sh"]
# 默认:前台启动网关,使用 /data/config.yaml,并注册常用适配器与协议
CMD [ \
"-c", "/data/config.yaml", \
"-r", "kook", "-r", "qq", "-r", "telegram", "-r", "feishu", "-r", "slack", \
"-r", "teams", "-r", "wecom", "-r", "wecom-kf", "-r", "discord", "-r", "dingtalk", "-r", "wechat", "-r", "wechat-ilink", \
"-p", "milky-v1", "-p", "satori-v1", "-p", "onebot-v12", "-p", "onebot-v11" \
]