# XuqmGroup 私有化部署 ## 快速开始 ```bash curl -fsSL https://xuqinmin.com/xuqmGroup/XuqmGroup-PrivateDeploy/raw/branch/main/install.sh \ -o install.sh && bash install.sh ``` 脚本自动完成:依赖检测 → 配置生成 → 镜像拉取 → 容器启动 → 租户初始化(新建或迁移)→ 全量验证。 部署完成后根据输出的端口表配置宿主机 nginx,详见 [docs/runbook.md](docs/runbook.md)。 ## 部署架构 ``` 用户 nginx(宿主机) │ ├── 127.0.0.1:11224 tenant-service /api/ /actuator/ ├── 127.0.0.1:11225 file-service /file/ ├── 127.0.0.1:11226 tenant-web / ├── 127.0.0.1:11227 ops-web /ops ├── 127.0.0.1:11228 im-service /api/im/ /ws/im ├── 127.0.0.1:11229 update-service /api/v1/updates/ /api/v1/rn/ ├── 127.0.0.1:11230 license-service /api/license/ └── 127.0.0.1:11231 push-service (厂商回调,按需) ``` 各服务仅绑定 `127.0.0.1`,外部无法直接访问,只有宿主机 nginx 能代理进去。 ## 租户初始化方式 安装脚本启动后交互式选择: - **新建租户**:填写邮箱、用户名、密码,首次启动自动创建 - **迁移租户**:在公有化平台安全中心生成迁移密钥(`pmk_` 开头),粘贴后自动完成导入 ## 服务说明 | Profile | 服务 | 说明 | |---------|------|------| | base | tenant-service, file-service, tenant-web, ops-web | 必选核心服务 | | infra-mysql | mysql | 托管数据库 | | infra-redis | redis | 托管缓存 | | im | im-service | IM HTTP + WebSocket | | push | push-service | 厂商推送 | | update | update-service | 版本管理 + RN 热更新 | | license | license-service | License 校验 | | nginx-bundled | nginx | 内置 nginx(默认不启动,用户有宿主机 nginx 时不需要) | ## 后期启用/禁用服务 ```bash ./scripts/enable-service.sh im ./scripts/disable-service.sh im ``` ## 注意事项 - `application.yml` 中数据库 URL 硬编码了生产地址,`docker-compose.yml` 的 `environment:` 节负责覆盖,**不能删除** - 所有容器绑定 `127.0.0.1`,nginx 中 `proxy_pass` 必须写 `127.0.0.1:1122x`,不能写 `localhost`(部分系统 localhost 解析为 IPv6) ## 文档 - [运行手册](docs/runbook.md) — 完整部署流程、nginx 配置、常用运维命令 - [配置说明](docs/configuration.md) — 各配置文件字段说明 - [验收清单](docs/acceptance-checklist.md) — 交付验收检查项