-
-
Notifications
You must be signed in to change notification settings - Fork 219
Docker部署
神代綺凛 edited this page Dec 11, 2023
·
15 revisions
已有的直接跳过
curl -fLsS https://get.docker.com/ | sh
新增或编辑 /etc/docker/daemon.json
{
"registry-mirrors": [
"https://dockerproxy.com"
]
}
使配置生效
systemctl daemon-reload
systemctl restart docker
# 创建一个 cqps 目录并在其中创建 data 目录,这里直接 -p 一次性解决
mkdir -p cqps/data
cd cqps
# 下载 Docker Compose 配置,国内可以在链接前加上 https://mirror.ghproxy.com/ 加速,后面同理
wget https://raw.githubusercontent.com/Tsuk1ko/cq-picsearcher-bot/master/docker-compose.yml
# 下载机器人配置文件并重命名为 config.jsonc,请按 wiki 中的配置文件说明改好配置
wget https://raw.githubusercontent.com/Tsuk1ko/cq-picsearcher-bot/master/config.default.jsonc -O config.jsonc
注意配置:
- go-cqhttp 配置 ws 监听地址要将 ip 部分改为
0.0.0.0
或 docker 宿主网关 ip 以允许 docker 容器连接 -
config.jsonc
配置要将cqws.host
设置为host.docker.internal
以连接宿主机
确认配置无误后使用下方命令运行
# 启动
docker-compose up -d
# 停止
docker-compose down
# 重启
docker-compose restart
# 查看日志
docker-compose logs
在使用过程中修改配置后无需重启,可以使用配置热重载指令
程序默认每隔一天检查一次更新,发现新版本会私聊 bot.admin
通知,可以修改 bot.checkUpdate
配置项来更改检查频率或关闭自动检查更新
检查更新仅作检查,更新操作仍然需要手动完成
docker-compose pull
docker-compose up -d
有部分功能在 docker 下需要差异化配置