revert: 撤掉单仓内的门户骨架,门户以独立仓 iotlcm-public/website 为唯一来源
mirror-to-gitee / mirror (push) Successful in 58s

原因
门户已拆分为独立仓 iotlcm-public/website(11:28 建仓,13:13 完成
fafc743「并入旧骨架独有价值内容,修 favicon 落地路径与过渡形态绑定」),
是门户的唯一事实来源。本仓 6c8314a 合并进来的 website/ 是拆分前的
旧骨架,继续保留会导致:
- 两份门户代码持续漂移,同一问题要在两个仓各修一遍
- 单仓 compose / gateway / Makefile 里残留 with-website profile 与
  /www/ 路由,与独立仓「门户自起容器、独立端口」的既定方案冲突

本提交 = revert -m 1 6c8314a,效果等同回到 e98f856
(git diff e98f856 HEAD 为空)。回退点:
tag backup/before-revert-portal-20261104 -> 6c8314a

门户部署改为(164 上,独立目录,不动 iotlcm-deploy):
  git clone https://git.5iot.com/iotlcm-public/website.git ~/iotlcm/website
  cd ~/iotlcm/website
  PORTAL_BIND_ADDR=0.0.0.0 docker compose -f deploy/docker-compose.yml up -d --build
This commit is contained in:
Dai0814
2026-11-04 13:16:29 +08:00
parent 6c8314a423
commit 9f15ff6f9e
23 changed files with 1 additions and 3296 deletions
-27
View File
@@ -34,7 +34,6 @@ docker compose --profile with-gateway up -d # 单端口入口(默认对外 5
docker compose --profile with-mock up -d # 运营商接口挡板
docker compose --profile with-bot up -d # 飞书通知(运维自用)
docker compose --profile with-nginx up -d # 多域名反向代理(对外 80)
docker compose --profile with-website up -d # 官网(项目门户站)
```
多个 profile 可组合:`--profile with-gateway --profile with-mock up -d`
@@ -53,37 +52,11 @@ GATEWAY_PORT=8088 docker compose --profile with-gateway up -d
| --- | --- |
| `/` | 管理端(admin-ui,内部已代理 `/api/` 到 admin-svr) |
| `/docs/` | 文档站 |
| `/www/` | 官网(需同时启用 `with-website`) |
| `/openapi/` | 对外 API |
| `/route/open/` | 运营商能力代理(白名单 / 共享 Token) |
配置见 `config/gateway/nginx.conf`。小程序 / H5 端的静态资源是根路径部署的,不能挂在同一域名的子路径下,需要单独域名或端口(见 `with-nginx` 的 app 段)。
### 官网(with-website)
项目门户站(项目介绍、功能矩阵、快速开始、教程入口),源码在仓库的 `website/` 目录,与文档站同构(VitePress)。
```bash
docker compose --profile with-website up -d --build website
```
镜像发布到公共仓库之前用 `--build` 本地构建;发布后去掉 `--build` 即可。
**两种形态**由构建参数 `WEBSITE_SITE_BASE` 决定:
| 形态 | 参数 | 访问方式 |
| --- | --- | --- |
| 子路径(过渡,无独立域名) | `/www/`(默认) | 网关的 `http://<主机>:5051/www/` |
| 独立域名 | `/` | 域名根路径,如 `https://<官网域名>/` |
```bash
# 独立域名形态
WEBSITE_SITE_BASE=/ docker compose --profile with-website up -d --build website
```
形态切换只改构建参数与入口配置,页面内容同源,不用改代码。独立域名形态下把 DNS 指到本机,
并在 `config/nginx/iotlcm.conf` 里加一段 `server_name <官网域名>` 的 vhost 指向 `website` 容器。
`with-bot` 是把全量同步等运维事件推送到飞书群的**内部运维工具**,不是平台功能。它需要你自己的飞书自建应用凭证(`config/bot/config.yaml` 的 `appId` / `appSecret` / `chatId`),没填就不启动。
**默认不启动,也不影响平台功能**;不需要飞书通知就完全不用管它。
-16
View File
@@ -10,7 +10,6 @@
# 路由:
# / -> 管理端(admin-ui,内部已代理 /api/ 到 admin-svr)
# /docs/ -> 文档站(docs)
# /www/ -> 官网(website,需启用 with-website profile)
# /openapi/ -> 对外 API(openapi)
# /route/open/ -> 运营商能力代理(openapi)
#
@@ -25,9 +24,6 @@ resolver 127.0.0.11 valid=10s ipv6=off;
upstream gw_admin_ui { zone gw_admin_ui 64k; server admin-ui:80 resolve; }
upstream gw_openapi { zone gw_openapi 64k; server openapi:8000 resolve; }
upstream gw_docs { zone gw_docs 64k; server docs:80 resolve; }
# 官网(可选组件,profile with-website)。容器未启动时该路径返回 502,
# 不影响其它路径;resolve 让容器 IP 变化后自动跟随。
upstream gw_website { zone gw_website 64k; server website:80 resolve; }
server {
listen 80;
@@ -55,18 +51,6 @@ server {
proxy_pass http://gw_docs;
}
# ---------- 官网(子路径形态) ----------
# 官网以 SITE_BASE=/www/ 构建时,资源引用是 /www/assets/...,
# 所以这里不能剥前缀(proxy_pass 不带尾斜杠),由官网容器内的
# alias 规则自己剥。域名定下来后改用独立 vhost,这段可删。
location = /www {
return 301 /www/;
}
location ^~ /www/ {
proxy_pass http://gw_website;
}
# ---------- 对外 API:版本化接口 ----------
location ^~ /openapi/ {
proxy_pass http://gw_openapi;
-25
View File
@@ -46,11 +46,6 @@ upstream iotlcm_app_server {
server app-server:8010 resolve;
}
upstream iotlcm_website {
zone iotlcm_website 64k;
server website:80 resolve;
}
# ---------- OpenAPI 对外域名 ----------
server {
listen 80;
@@ -122,26 +117,6 @@ server {
}
}
# ---------- 官网 ----------
# 独立域名形态:把 server_name 换成实际官网域名,
# 并让 DNS 指到这台机器。官网容器以 SITE_BASE=/ 构建(资源引用为 /assets/...),
# 所以这里按根路径转发。
server {
listen 80;
server_name www.your-domain.example.com;
client_max_body_size 200m;
location / {
proxy_pass http://iotlcm_website;
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;
}
}
# ---------- 小程序 / H5 ----------
server {
listen 80;
-31
View File
@@ -398,37 +398,6 @@ services:
retries: 5
start_period: 10s
# ---------------- 官网(开源版门户站) ----------------
# 项目介绍、功能矩阵、快速开始、教程入口的门户站。
# 过渡形态(没有独立域名):单独占用一个宿主机端口,用 http://<主机>:8020/ 访问;
# 独立域名形态:把 DNS 指到这台机器,用 config/nginx/iotlcm.conf 的 website 段接管根路径。
# 镜像与 docs 同构(构建上下文 website/,Dockerfile website/Dockerfile)。
website:
# 官方镜像发布前先本地构建:docker compose --profile with-website up -d --build website
# 发布后删掉 build 段,直接用 ACR 镜像。
image: 'crpi-qflrqrxoohlkkvgc.cn-chengdu.personal.cr.aliyuncs.com/iotlcm/iotlcm:iotlcm-website-v1.0.4'
build:
context: ../website
dockerfile: Dockerfile
args:
SITE_BASE: '${WEBSITE_SITE_BASE:-/www/}'
container_name: iotlcm-website
restart: unless-stopped
ports:
- "127.0.0.1:8020:80"
networks:
- iotlcm-network
# 探针路径与官网形态一致:默认以 SITE_BASE=/www/ 构建,官网在容器的 /www/ 下。
# 若改成独立域名形态(SITE_BASE=/),把这里的 /www/ 改成 /。
healthcheck:
test: ["CMD", "wget", "--quiet", "--output-document=/dev/null", "http://127.0.0.1/www/"]
interval: 10s
timeout: 3s
retries: 5
start_period: 10s
profiles:
- with-website
# ---------------- 可选:运营商接口挡板 ----------------
# 模拟中国移动 OneLink 接口,用于在没有真实运营商环境时联调整条链路:
# admin-svr → worker-svr → upstream-chan → onelink-mock