docs: 优化部署文档

This commit is contained in:
tangtaoit 2023-08-02 11:29:49 +08:00
parent d410996120
commit 937b9e1caa
8 changed files with 163 additions and 6 deletions

View File

@ -17,14 +17,17 @@ export const sidebar: DefaultTheme.Sidebar = {
text: "快速开始",
collapsed: false,
items: [
{ text: "部署", link: "/guide/quickstart" },
{ text: "集成到自己系统", link: "/guide/integration" },
{ text: "一键部署(推荐)", link: "/guide/deploy-default" },
{ text: "Docker方式部署", link: "/guide/deploy-docker" },
{ text: "Docker Compose方式部署", link: "/guide/deploy-dockercompose" },
{ text: "部署配置", link: "/guide/deploy-config" },
],
},
{
text: "进阶",
collapsed: false,
items: [
{ text: "集成到自己系统", link: "/guide/integration" },
{ text: "最佳实践", link: "/guide/practice" },
{ text: "配置说明", link: "/guide/fullconfig" },
{ text: "WSS 配置", link: "/guide/wss" },

View File

@ -49,7 +49,7 @@ API 规则:
```json
[uid123,uid32323,....] // 用户uid集合
["uid123","uid32323",....] // 用户uid集合
```

View File

@ -0,0 +1,36 @@
# 部署配置
`配置修改需要重启服务,重启服务方式查看对应的部署方式的章节`
## 1. 配置IP地址
配置文件在 `~/wukongim/wk.yaml` (如果没有就新建)
需要修改配置文件中的 `external.ip` 为服务器外网 IP如果本地电脑部署没有外网IP可填写本机局域网IP。如下
```yaml
external:
ip: 'xxx.xxx.xxx.xxx'
```
[完整配置说明](/guide/fullconfig)
## 2. 开放端口
5001: http api 端口
5100: app 长连接的 tcp 端口
5172: demo端口用于测试
5200: websocket 端口web 或 pc 长连接使用的
5300: 监控端口,可以查看服务的运行状态(待完善)
查看服务器信息: http://127.0.0.1:5001/varz
查看监控系统: http://127.0.0.1:5300/web
chat demo http://127.0.0.1:5172/chatdemo

View File

@ -0,0 +1,52 @@
# 一键部署(推荐)
## 部署
安装部署脚本
```shell
curl -sSL https://gitee.com/WuKongDev/WuKongIMCli/raw/main/install.sh | sudo bash
```
开始服务
```shell
wk start
```
重启服务
```shell
wk stop
```
```shell
wk start
```
`wk stop如果有报错可以忽略`
## 配置
[部署配置](/guide/deploy-config)
## 验证
```shell
wk doctor
```
```shell
[✓] Http Service is running in 5001
[✓] TCP Service is running in 5100
[✓] Monitor Service is running in 5300
• No issues found!
```

View File

@ -0,0 +1,31 @@
# Docker 部署
## 部署
启动服务
```shell
docker run -d -p 5001:5001 -p 5100:5100 -p 5172:5172 -p 5200:5200 -p 5300:5300 --name wukongim -v ~/wukongim:/root/wukongim wukongim/wukongim:latest
```
`(如果慢镜像可以替换为国内的: registry.cn-shanghai.aliyuncs.com/wukongim/wukongim:latest`
重启服务
```shell
docker stop wukongim
```
```shell
docker start wukongim
```
## 配置
[部署配置](/guide/deploy-config)

View File

@ -0,0 +1,35 @@
# Docker Compose 部署
## 部署
克隆项目
```shell
git clone https://github.com/WuKongIM/WuKongIM.git
```
进入到项目内
```shell
cd WuKongIM
```
启动服务
```shell
docker-compose up -d
```
重启服务
```shell
docker-compose restart
```
## 配置
[部署配置](/guide/deploy-config)

View File

@ -681,7 +681,7 @@ cmd 消息由服务端下发客户端解析。
#### 数据监听
```obkc
```objc
[[WKSDK shared].channelManager addDelegate:self] // WKChannelManagerDelegate

View File

@ -63,15 +63,15 @@ const WKSDK = require("wukongimjssdk").default
``` js [浏览器]
<script src="https://cdn.jsdelivr.net/npm/wukongimjssdk@1.0.9/lib/wukongimjssdk.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/wukongimjssdk@1.1.0/lib/wukongimjssdk.umd.js"></script>
浏览器使用必须都加前缀 wk, 例如 wk.WKSDK.shared()
```
:::
`通过<script>标签引入使用必须都加前缀 wk, 例如 wk.WKSDK.shared()`
### 初始化