docs: 重写 README(用户视角,含手册跳转)+ 去掉「开源版」措辞 + 单端口入口 5051
README - 标题去掉「(开源版)」:对使用者就是 iotLCM - 新增「文档」表:使用手册(Web 端 / 小程序端)、部署手册、OpenAPI 合同、 共享 Token 接口,全部指向仓内 docs/ 路径;并给出部署后的文档站地址 - 补功能概览、服务构成(带镜像 tag)、从源码构建、版本与镜像、许可 去措辞 - Gitee 建仓描述同步去掉「(开源版)」 单端口入口(新增,对外默认 5051) - deploy/config/gateway/nginx.conf:/ → 管理端、/docs/ → 文档站、 /openapi/ 与 /route/open/ → openapi - compose 增加 gateway 服务(profile with-gateway),端口由 GATEWAY_PORT 控制 实测:/ 200、/docs/ 200(含静态资源)、/api/agent/dept/list 200、 /api/system/auth/login 返回后端真实 JSON - nginx profile 的 80 端口改为可配 NGINX_HTTP_PORT(文档早有提及但 compose 写死) - 部署手册概览页修正过期内容(schema 单文件、服务清单补全)、optional 增单端口入口段
This commit is contained in:
+24
-4
@@ -30,12 +30,32 @@ docker compose logs -f mysql
|
||||
## 可选服务
|
||||
|
||||
```bash
|
||||
docker compose --profile with-mock up -d # 运营商接口挡板
|
||||
docker compose --profile with-bot up -d # 飞书通知(运维自用)
|
||||
docker compose --profile with-nginx up -d # 自带反向代理
|
||||
docker compose --profile with-gateway up -d # 单端口入口(默认对外 5051)
|
||||
docker compose --profile with-mock up -d # 运营商接口挡板
|
||||
docker compose --profile with-bot up -d # 飞书通知(运维自用)
|
||||
docker compose --profile with-nginx up -d # 多域名反向代理(对外 80)
|
||||
```
|
||||
|
||||
多个 profile 可组合:`--profile with-mock --profile with-nginx up -d`
|
||||
多个 profile 可组合:`--profile with-gateway --profile with-mock up -d`
|
||||
|
||||
### 单端口入口(with-gateway)
|
||||
|
||||
只暴露一个端口时用它。容器内监听 80,宿主机端口由 `GATEWAY_PORT` 控制(默认 **5051**):
|
||||
|
||||
```bash
|
||||
docker compose --profile with-gateway up -d
|
||||
# 或换端口
|
||||
GATEWAY_PORT=8088 docker compose --profile with-gateway up -d
|
||||
```
|
||||
|
||||
| 路径 | 去向 |
|
||||
| --- | --- |
|
||||
| `/` | 管理端(admin-ui,内部已代理 `/api/` 到 admin-svr) |
|
||||
| `/docs/` | 文档站 |
|
||||
| `/openapi/` | 对外 API |
|
||||
| `/route/open/` | 运营商能力代理(白名单 / 共享 Token) |
|
||||
|
||||
配置见 `config/gateway/nginx.conf`。小程序 / H5 端的静态资源是根路径部署的,不能挂在同一域名的子路径下,需要单独域名或端口(见 `with-nginx` 的 app 段)。
|
||||
|
||||
`with-bot` 是把全量同步等运维事件推送到飞书群的**内部运维工具**,不是平台功能。它需要你自己的飞书自建应用凭证(`config/bot/config.yaml` 的 `appId` / `appSecret` / `chatId`),没填就不启动。
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# 单端口入口(默认对外 5051)
|
||||
#
|
||||
# 用途:把管理端、文档站、OpenAPI 收在一个端口下,便于在外部网关 / DNS
|
||||
# 只暴露一个地址。编排里由 gateway 服务(profile: with-gateway)加载本文件,
|
||||
# 容器内监听 80,宿主机发布端口用 GATEWAY_PORT 控制(默认 5051)。
|
||||
#
|
||||
# docker compose --profile with-gateway up -d
|
||||
# GATEWAY_PORT=8088 docker compose --profile with-gateway up -d
|
||||
#
|
||||
# 路由:
|
||||
# / -> 管理端(admin-ui,内部已代理 /api/ 到 admin-svr)
|
||||
# /docs/ -> 文档站(docs)
|
||||
# /openapi/ -> 对外 API(openapi)
|
||||
# /route/open/ -> 运营商能力代理(openapi)
|
||||
#
|
||||
# 小程序 / H5 端的静态资源是根路径部署的,不能挂在同一域名的子路径下,
|
||||
# 需要单独域名或单独端口(见 config/nginx/iotlcm.conf 的 app 段)。
|
||||
|
||||
upstream gw_admin_ui { server admin-ui:80; }
|
||||
upstream gw_openapi { server openapi:8000; }
|
||||
upstream gw_docs { server docs:80; }
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
charset utf-8;
|
||||
client_max_body_size 200m;
|
||||
|
||||
access_log /var/log/nginx/access_gateway.log;
|
||||
error_log /var/log/nginx/error_gateway.log;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 120s;
|
||||
proxy_send_timeout 120s;
|
||||
|
||||
# ---------- 文档站 ----------
|
||||
location = /docs {
|
||||
return 301 /docs/;
|
||||
}
|
||||
|
||||
location ^~ /docs/ {
|
||||
proxy_pass http://gw_docs;
|
||||
}
|
||||
|
||||
# ---------- 对外 API:版本化接口 ----------
|
||||
location ^~ /openapi/ {
|
||||
proxy_pass http://gw_openapi;
|
||||
}
|
||||
|
||||
# ---------- 对外 API:运营商能力代理(白名单 / 共享 Token)----------
|
||||
location ^~ /route/open/ {
|
||||
proxy_pass http://gw_openapi;
|
||||
}
|
||||
|
||||
# ---------- 管理端(含 /api/ 与 /upload/,由 admin-ui 自行转发)----------
|
||||
location / {
|
||||
proxy_pass http://gw_admin_ui;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 1k;
|
||||
gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;
|
||||
}
|
||||
@@ -410,7 +410,7 @@ services:
|
||||
container_name: iotlcm-nginx
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
- "${NGINX_HTTP_PORT:-80}:80"
|
||||
volumes:
|
||||
- ./config/nginx:/etc/nginx/conf.d:ro
|
||||
- ./data/logs/nginx:/var/log/nginx
|
||||
@@ -425,6 +425,25 @@ services:
|
||||
profiles:
|
||||
- with-nginx
|
||||
|
||||
# 单端口入口:管理端 + 文档站 + OpenAPI 收在一个端口(默认 5051)对外
|
||||
gateway:
|
||||
image: 'crpi-qflrqrxoohlkkvgc.cn-chengdu.personal.cr.aliyuncs.com/iotlcm/iotlcm:nginx-1.30'
|
||||
container_name: iotlcm-gateway
|
||||
restart: always
|
||||
ports:
|
||||
- "${GATEWAY_PORT:-5051}:80"
|
||||
volumes:
|
||||
- ./config/gateway:/etc/nginx/conf.d:ro
|
||||
- ./data/logs/gateway:/var/log/nginx
|
||||
networks:
|
||||
- iotlcm-network
|
||||
depends_on:
|
||||
- admin-ui
|
||||
- openapi
|
||||
- docs
|
||||
profiles:
|
||||
- with-gateway
|
||||
|
||||
networks:
|
||||
iotlcm-network:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user