3d2851a1f1aaa887eb1542e779ce59fdd5ffe1ef
Co-authored-by: Cursor <cursoragent@cursor.com>
宇信达智建
要不要上 K8s?
现阶段不需要。 Docker Compose 已覆盖单机/小团队全栈;等出现多机部署、弹性扩缩容、灰度发布、服务网格等需求再上 Kubernetes。
推荐拓扑(默认 Docker)
浏览器
→ web :5173 (nginx)
→ gateway :8180
→ platform :8888
→ ai :8001
→ postgres :5432
数据挂载到仓库物理目录 .runtime/(不是仅存在容器层)。
一键启动
先启动 Docker Desktop(Windows)或确保 docker compose 可用。
Windows
.\start.ps1 # 默认 Compose 全栈
.\start.ps1 -Rebuild
.\stop.ps1
.\restart.ps1 # 先停再启
也可双击 start.bat / restart.bat。
Linux
chmod +x start.sh stop.sh restart.sh pull-and-restart.sh scripts/linux/*.sh
./start.sh # 默认先从 Gitea 拉代码再 Compose 启动
./start.sh --rebuild
./start.sh --no-pull # 跳过拉取
./pull-and-restart.sh # 拉最新后重启
./stop.sh
./restart.sh # 先停再启(不拉代码)
代码源默认:https://gitea.yuxindazhineng.com/whm/ai_site.git(分支 main)。
可用环境变量 AIJZ_GIT_URL / GIT_BRANCH / AIJZ_SKIP_GIT_PULL=1 覆盖(见 .env.example)。
无 Docker 时脚本会自动回退宿主机模式(--host 可强制)。
| 物理路径 | 内容 |
|---|---|
.runtime/pgdata |
Postgres 数据 |
.runtime/uploads |
对象存储 |
.runtime/logs |
(宿主机模式日志) |
打开 http://127.0.0.1:5173
演示账号:demo / demo123
等价手动命令:
docker compose up -d --build
docker compose down # 保留 .runtime
能力清单
| 能力 | 说明 |
|---|---|
| RBAC | JWT 含 role(owner/editor/viewer) |
| 对象存储 | 上传落 .runtime/uploads |
| 发布审计 | GET /api/v1/audit/logs |
| database_per_app | 独立库;compose 内 platform 用户已具备建库权限 |
| 网关鉴权 | JWT 预检 + 中台二次校验 |
| 多模态 | 截图理解(可设 OPENAI_API_KEY) |
自动化测试
python scripts/e2e_flow.py
网关路由
| 路径 | 上游 |
|---|---|
/api/v1/* |
platform |
/ai/* |
AI |
/gateway/health |
健康检查 |
可选 APISIX 仍见 gateway/README.md(:9080),日常用 Compose 里的 Go 网关即可。
Description
Languages
Go
49.8%
TypeScript
24.4%
Python
14.9%
HTML
6.4%
CSS
2.2%
Other
2.3%