doc: 优化部署教程

This commit is contained in:
Junyan Qin
2024-11-18 23:44:42 +08:00
parent 7d010c4689
commit cd260f390d
8 changed files with 58 additions and 36 deletions
+28
View File
@@ -0,0 +1,28 @@
# 消息平台和 LangBot 连接
如果消息平台(NapCat/Lagrange)和 LangBot 均使用 Docker 启动,那么你需要配置 Docker 的网络连接。
新建一个网络:
```bash
docker network create langbot-network
```
在 LangBot 目录的 `docker-compose.yaml` 文件中添加网络配置(添加到 `services.langbot` 字段下,并在 `networks` 字段下添加 `langbot-network` 网络配置):
```yaml
services:
langbot:
...
networks:
- langbot-network
...
networks:
langbot-network:
driver: bridge
```
然后在消息平台的 `docker-compose.yaml` 文件中添加同样的网络配置(如果是直接 docker run 命令启动的,请在启动命令中添加 `--network langbot-network`)。接着在消息平台配置文件中,把 WS 反向连接地址中的 IP 地址修改为 `langbot`(例如:`ws://langbot:2280/ws`)。
重启两个容器。