feat: 权限与日志治理完善,MinIO 独立部署与 tiktoken 离线打包适配

- 后端:强化平台/审批/资源/系统接口权限校验与操作日志,更新权限设计文档与测试用例
- 存储:新增 MinIO 独立部署适配(端口 19000/19001),外部端点与 host-gateway 互通
- 离线:打包 tiktoken cl100k_base 词表进镜像,避免无网环境联网下载
- 其他:算力节点接口微调,前端微调创建页小修,忽略 MinIO 运行时数据

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
wuyongtao
2026-08-12 15:21:23 +08:00
parent 2f64086177
commit 5ecca9f0bc
26 changed files with 101600 additions and 129 deletions

View File

@@ -1,5 +1,19 @@
# Docker 部署说明
## 跨服务器部署
MinIO、Backend API 和 Compute API 使用各自服务器上的独立 Docker 网络,不能使用跨服务器的容器名称互访。当前 WSL 联调地址为 `172.25.179.69`
```env
# docker/app/.env
MINIO_ENABLED=true
MINIO_ENDPOINT=http://172.25.179.69:19000
COMPUTE_API_BASE_URL=http://172.25.179.69:19100
FILE_GATEWAY_BASE_URL=http://172.25.179.69:19101
```
拆分到不同服务器后,将 `172.25.179.69` 替换为对应服务器 IP。MinIO 容器内部仍使用 `9000/9001`,对外使用 `19000/19001`Backend 和 Compute API 通过外部 IP 访问 MinIO不加入 MinIO 的 Docker 网络。
本目录按应用服务器和算力服务器拆分 Dockerfile 与 Docker Compose 文件。Compose 文件不包含 `build:`,不会在 `docker compose up` 时自动构建业务镜像。所有业务镜像需要先通过手动 `docker build` 构建,再由 Compose 启动。
## 基础镜像

View File

@@ -50,10 +50,14 @@ COMPUTE_POLL_BATCH_SIZE=100
COMPUTE_REQUEST_TIMEOUT_SECONDS=5
# MinIO object storage. Enable after the MinIO service is reachable.
MINIO_ENABLED=false
MINIO_ENDPOINT=http://minio:9000
MINIO_API_PORT=19000
MINIO_CONSOLE_PORT=19001
MINIO_ENABLED=true
# For split-server deployment, replace host.docker.internal with the MinIO
# server address, for example http://10.10.20.30:19000.
MINIO_ENDPOINT=http://172.25.179.69:19000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_SECRET_KEY=change_me_minio_secret
MINIO_BUCKET=yg-ft-resources
MINIO_SECURE=false
STORAGE_WAIT_SECONDS=300

View File

@@ -63,7 +63,9 @@ services:
COMPUTE_POLL_BATCH_SIZE: ${COMPUTE_POLL_BATCH_SIZE:-100}
COMPUTE_REQUEST_TIMEOUT_SECONDS: ${COMPUTE_REQUEST_TIMEOUT_SECONDS:-5}
MINIO_ENABLED: ${MINIO_ENABLED:-false}
MINIO_ENDPOINT: ${MINIO_ENDPOINT:-http://minio:9000}
# Use the storage server's externally reachable address. Do not use a
# MinIO container name because storage is deployed independently.
MINIO_ENDPOINT: ${MINIO_ENDPOINT:-http://host.docker.internal:19000}
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
MINIO_BUCKET: ${MINIO_BUCKET:-yg-ft-resources}
@@ -75,6 +77,8 @@ services:
- ../../backend:/app:ro
- ../../runtime/app/logs/backend:/opt/yg-ft/logs/backend
- ../../runtime/app/data:/data/yg-ft
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- yg-ft-app
healthcheck:

100256
docker/app/tiktoken/cl100k_base Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,9 @@
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=change_me_minio_secret
MINIO_API_PORT=9000
MINIO_CONSOLE_PORT=9001
MINIO_API_PORT=19000
MINIO_CONSOLE_PORT=19001
MINIO_DATA_ROOT_HOST=./data
# Backend and Compute API use this externally reachable endpoint when MinIO
# runs on a separate server. Keep the container's internal API port at 9000.
MINIO_EXTERNAL_ENDPOINT=http://<storage-server-ip>:19000

View File

View File

@@ -7,8 +7,8 @@ services:
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-change_me_minio_secret}
ports:
- "${MINIO_API_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
- "${MINIO_API_PORT:-19000}:9000"
- "${MINIO_CONSOLE_PORT:-19001}:9001"
volumes:
- ${MINIO_DATA_ROOT_HOST:-./data}:/data
healthcheck: