//除非重大更新,否则不必重新拉去镜像
docker exec -it wxbot git pull
docker exec -it wxbot npm i
//更新并【填写】配置文件
cd /root/wxbot/conf && mv config.js config.js.bak
wget https://ghproxy.com/https://raw.githubusercontent.com/hxianseng/wxbot/master/src/conf/config.js
//重启容器
docker restart wxbot
//安装docker
sudo curl -sSL get.docker.com | sh
//配置国内源
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://0b27f0a81a00f3560fbdc00ddd2f99e0.mirror.swr.myhuaweicloud.com",
"https://ypzju6vq.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn"
]
}
EOF
systemctl daemon-reload
systemctl restart docker
//拉取镜像
docker pull hxiansen/wxbot:latest
cd /root && mkdir -p wxbot/conf
//下载并【填写】配置文件
wget https://ghproxy.com/https://raw.githubusercontent.com/hxianseng/wxbot/master/src/conf/config.js -P ./wxbot/conf/
//启动容器
docker run -d \
-v /root/wxbot/conf:/usr/wxbot/src/conf \
--name wxbot \
--net host \
--restart always \
hxiansen/wxbot:latest
//更新依赖包
docker exec -it wxbot npm i
//重启容器
docker restart wxbot
//浏览器打开http://IP:端口/api/v1/qrcodeImage微信扫码登陆