-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker deployment for Hoshino #52
base: master
Are you sure you want to change the base?
Conversation
Good idea. Daemon is very useful! But for docker, Hoshino need to direct access to custom RESOURCE_DIR, you should also make a link. More tests required. |
For the RESOURCE_DIR, just mount the directory to the container by docker run -d --name=hoshino \
-v ~/.hoshino:/root/.hoshino \
-p 8080:8080 \
hoshino |
I know. But RESOURCE_DIR is custom. It doesn't have to in |
I see. README updated in the latest commit. |
Basically, there're 3 advantages to deploy Hoshino with docker.
Anyway, docker deployment is just an option. |
大佬大佬,我觉得docker对于linux自建来说还是可以的,但是想自己定制化机器人就显得比较麻烦,hoshinobot整个的框架已经挺完善了,很容易自己写点小东西来学习玩耍:-( |
docker部署优点在于隔离性好,无须任何额外环境配置。 至少我看好几个想用Hoshino的人,连配环境都不会,有各种各样的问题(我自己配环境的时候也因为系统缺少_sqlite 导致我得自行编译python3.8,属实麻烦)。他们也不会conda等工具管理虚拟环境,这种情况下,docker一键部署对他们来说是一个更好的选择。(连配环境都不会,所以他们当然更不会去改代码了…) |
我觉得docker比较适合作为发行版,或许可以直接放到docker hub上,但缺点在于需要经常去维护。 |
Dockerfile 一般都是本地将代码和配置文件拷贝到容器内,不知道你是想怎么做? |
环境变量是修改docker中的配置的常用手段。比如cqhttp镜像就是通过环境变量来修改配置文件。 |
config.json是各插件独立的,插件的功能不同其中的结构也不同。比较简单的仅存放一个AUTH_KEY,而复杂的则存了多个列表、字典(如gacha/config.json),我想这不是简单修改环境变量就能调整的。 |
|
仅生成包含必要环境的镜像。运行时将代码挂载。通过 docker-compose 启停。 |
使用 docker 网络,避免 8080 端口暴露在外。 |
将中文字体复制到镜像内。防止 Matplotlib 生成的图像中的中文显示乱码。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YaHei is owned by Microsoft, we should not add it in to our repo. You can provide a download link, or guide the users to copy themselves font.
050ff19
to
f8c80a8
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ttf file (14.3MB) is still in the repo(笑)
Doesn't matter, I'll deal with it.
https://github.com/Ice-Cirno/HoshinoBot/compare/050ff19cf8ec008ed78db0583e1d8748db6c62fe..f8c80a873c18ee208fadee725b00e9e06a3c7d19 |
Yes, you delete it indeed, but it is still tracked by git. |
lol. interesting. |
是不是可以参考一下yobot的docker部署方式。如果以后添加工会战web管理功能,docker的物理隔离就十分重要了,毕竟web那套东西没有物理隔离在自己服务器上跑谁都不放心。 |
Hoshino can be run as daemon in linux, implemented by python-daemon.
Hoshino can be deployed by docker.
Usage is updated in README.