2021-05-05 09:29:49 +00:00
|
|
|
## 使用方法
|
|
|
|
|
|
|
|
### 使用 Docker 安装
|
|
|
|
官方安装地址:[点击访问](https://docs.docker.com/engine/install/)
|
2021-05-05 09:25:02 +00:00
|
|
|
|
|
|
|
```angular2html
|
|
|
|
cd /root
|
|
|
|
|
2021-05-05 09:29:49 +00:00
|
|
|
# 拉取Redis镜像
|
2021-05-05 09:25:02 +00:00
|
|
|
docker pull redis
|
|
|
|
|
2021-05-05 09:29:49 +00:00
|
|
|
# 创建 entrypoint.sh 入口文件
|
2021-05-05 09:25:02 +00:00
|
|
|
echo '#! /bin/sh \
|
|
|
|
cd /root/word_cloud_bot && python3 main.py >> output 2>&1 &
|
|
|
|
tail -f /dev/null' > /root/entrypoint.sh
|
|
|
|
|
2021-05-05 09:29:49 +00:00
|
|
|
# 创建 Dockerfile
|
2021-05-05 09:25:02 +00:00
|
|
|
wget -O /root/Dockerfile https://github.com/devourbots/word_cloud_bot/raw/master/Dockerfile
|
|
|
|
|
2021-05-05 09:29:49 +00:00
|
|
|
# 修改机器人TOKEN
|
2021-05-05 09:25:02 +00:00
|
|
|
vi /root/Dockerfile
|
|
|
|
|
|
|
|
在第六行修改你的机器人TOKEN
|
|
|
|
|
2021-05-05 09:29:49 +00:00
|
|
|
# 根据 Dockerfile 创建镜像
|
2021-05-05 09:25:02 +00:00
|
|
|
docker build . -t world_cloud_bot:latest
|
|
|
|
|
2021-05-05 09:29:49 +00:00
|
|
|
# 运行 Redis 镜像,此步在前
|
2021-05-05 09:25:02 +00:00
|
|
|
docker run -d -p 6379:6379 redis:latest
|
|
|
|
|
2021-05-05 09:29:49 +00:00
|
|
|
# 运行 机器人,此步在后
|
2021-05-05 09:25:02 +00:00
|
|
|
docker run -d --net=host world_cloud_bot:latest
|
|
|
|
```
|