init: IotLCM 开源版部署仓

内容:
- docker-compose.yml:14 个基础/业务服务 + 3 个可选 profile(with-mock 挡板、with-bot、with-nginx)
- .env.example:集中管理镜像仓库、口令、端口;必填项缺失时 compose 直接报错退出
- config.example/:10 份配置模板,全部为占位值与注释说明
- schema/:12 个初始化脚本,按文件名顺序由 MySQL initdb 自动执行

脱敏处理:
- 生产/内网 IP、镜像仓库地址、公司名、真实域名全部清除
- 演示账号保留 18 个(出库与划拨依赖账号与部门树的关联),
  昵称/邮箱/手机号/登录IP/头像改为占位或编造值
- 数据库账号与 admin 口令改为初始化时按 .env 注入计算
- 通道模板与 Mock 通道的上游密钥置空
- Mock 通道地址指向 compose 内 onelink-mock 服务

部署时用 --profile with-mock 启动运营商接口挡板,即可在无真实运营商环境时跑通全链路。
This commit is contained in:
MiFaZhan
2026-10-28 13:40:12 +08:00
commit bc2c7bcc6b
26 changed files with 7264 additions and 0 deletions
+141
View File
@@ -0,0 +1,141 @@
# ============================================================
# IotLCM 对外入口 nginx 配置示例
#
# 作用:把多个服务按路径分流到统一域名下。
# 若宿主机已有 nginx 或面板,可不启动本容器,
# 把下面的 location 段落并入宿主机配置即可。
#
# 把 your-domain.example.com 替换为你的实际域名。
# ============================================================
upstream iotlcm_admin_api {
server admin-svr:8008;
}
upstream iotlcm_admin_ui {
server admin-ui:80;
}
upstream iotlcm_openapi_api {
server openapi:8000;
}
upstream iotlcm_docs {
server docs:80;
}
upstream iotlcm_app_web {
server app-web:80;
}
upstream iotlcm_app_server {
server app-server:8010;
}
# ---------- OpenAPI 对外域名 ----------
server {
listen 80;
server_name api.your-domain.example.com;
client_max_body_size 200m;
location ^~ /openapi/v3/ {
proxy_pass http://iotlcm_openapi_api;
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;
}
# 运营商能力代理(白名单转发 / 共享 Token)
location ^~ /route/open/ {
proxy_pass http://iotlcm_openapi_api;
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 / {
proxy_pass http://iotlcm_openapi_api;
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;
}
}
# ---------- 管理端 ----------
server {
listen 80;
server_name admin.your-domain.example.com;
client_max_body_size 200m;
location / {
proxy_pass http://iotlcm_admin_ui;
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;
}
# 文档站(子路径 /docs/)
location = /docs {
return 301 /docs/;
}
location /docs/ {
proxy_pass http://iotlcm_docs;
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;
server_name app.your-domain.example.com;
client_max_body_size 200m;
location ^~ /app/api/v1/ {
proxy_pass http://iotlcm_app_server/api/v1/;
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 ^~ /app/ {
proxy_pass http://iotlcm_app_web;
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;
}
location / {
proxy_pass http://iotlcm_app_web;
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;
}
}