Version: 0.9.82.dev.260507
后端: 1. 登录注册补齐极验行为验证与跨域入口:gateway 新增 `/user/captcha/register`,登录/注册先做 GeeTest 初始化与二次校验,再进入 user/auth RPC;补充验证码失败/初始化失败/服务不可用响应码,并新增可配置 CORS middleware 适配分域部署。 2. 容器部署配置入口收口:`bootstrap.LoadConfig` 支持 `SMARTFLOW_CONFIG_FILE` 与环境变量覆盖,`config.example.yaml` / `config.docker.yaml` 补齐 geetest 与容器内服务地址,网关新增配置列表解析,便于 compose 场景直接挂载配置启动。 3. LLM outbox 与助手时间线稳定性修正:`cmd/llm` 显式绑定 llm 自身 topic/group,避免误入 agent consumer group;agent timeline 在 Redis 热缓存未落 MySQL 时改用 `seq` 兜底临时 id,避免前端历史回放撞 key。 前端: 4. 认证页接入极验并补齐提交前校验:新增 GeeTest 脚本加载与实例封装,登录/注册面板支持 challenge 初始化、切换面板重挂载、失败提示与提交前校验,认证 API/types 同步透传 geetest 三元组。 5. 前端部署基址与网关对接收口:Axios `baseURL`、Vue Router `history base` 与 Vite `base/dev proxy` 改为读取环境变量,新增 `frontend/.env.example`,支持子路径部署、容器内反向代理和本地联调共存。 6. 助手与工作台展示细节修正:AssistantPanel 历史重建优先使用真实 timeline id、缺失时退回 `seq` 保证消息主键唯一;首页主面板改为纵向可滚动并补底部留白,避免内容截断。 仓库: 7. 整站容器化交付链路补齐并重写说明文档:新增后端/前端 Dockerfile、`.dockerignore`、前端 Nginx 代理、`docker-compose.full.yml`、`.env.full.example` 与镜像打包/导入脚本,README 改写数据库/路由/部署章节,并新增 `docs/容器化部署说明.md` 说明离线镜像分发方案。
This commit is contained in:
301
docker-compose.full.yml
Normal file
301
docker-compose.full.yml
Normal file
@@ -0,0 +1,301 @@
|
||||
name: smartflow-full
|
||||
|
||||
x-backend-common: &backend-common
|
||||
image: ${SMARTFLOW_BACKEND_IMAGE:-smartflow/backend-suite:latest}
|
||||
restart: unless-stopped
|
||||
working_dir: /app/backend
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
SMARTFLOW_CONFIG_FILE: /app/backend/config.docker.yaml
|
||||
SMARTFLOW_NOTIFICATION_FRONTENDBASEURL: ${SMARTFLOW_NOTIFICATION_FRONTENDBASEURL:-}
|
||||
SMARTFLOW_CORS_ALLOWEDORIGINS: ${SMARTFLOW_CORS_ALLOWEDORIGINS:-}
|
||||
volumes:
|
||||
- ./backend/config.docker.yaml:/app/backend/config.docker.yaml:ro
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
kafka:
|
||||
condition: service_healthy
|
||||
kafka-init:
|
||||
condition: service_completed_successfully
|
||||
etcd:
|
||||
condition: service_healthy
|
||||
minio:
|
||||
condition: service_healthy
|
||||
milvus-standalone:
|
||||
condition: service_healthy
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: ${SMARTFLOW_MYSQL_IMAGE:-mysql:8.0}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root_password_123
|
||||
MYSQL_DATABASE: smartflow
|
||||
MYSQL_USER: smartflow_user
|
||||
MYSQL_PASSWORD: smartflow_password_456
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "mysqladmin ping -h localhost -uroot -proot_password_123"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
redis:
|
||||
image: ${SMARTFLOW_REDIS_IMAGE:-redis:7}
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes --requirepass redis_password_789
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "-a", "redis_password_789", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
kafka:
|
||||
image: ${SMARTFLOW_KAFKA_IMAGE:-apache/kafka:3.7.2}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
KAFKA_NODE_ID: 1
|
||||
KAFKA_PROCESS_ROLES: broker,controller
|
||||
CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk
|
||||
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
|
||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
|
||||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT
|
||||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
|
||||
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
|
||||
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
|
||||
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
|
||||
KAFKA_NUM_PARTITIONS: 3
|
||||
KAFKA_DEFAULT_REPLICATION_FACTOR: 1
|
||||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
||||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
|
||||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
|
||||
KAFKA_LOG_DIRS: /var/lib/kafka/data
|
||||
volumes:
|
||||
- kafka_data:/var/lib/kafka/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "/opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list >/dev/null 2>&1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
|
||||
kafka-init:
|
||||
image: ${SMARTFLOW_KAFKA_IMAGE:-apache/kafka:3.7.2}
|
||||
restart: "no"
|
||||
depends_on:
|
||||
kafka:
|
||||
condition: service_healthy
|
||||
entrypoint:
|
||||
- /bin/bash
|
||||
- -lc
|
||||
- |
|
||||
set -e
|
||||
for topic in \
|
||||
smartflow.agent.outbox \
|
||||
smartflow.task.outbox \
|
||||
smartflow.memory.outbox \
|
||||
smartflow.active-scheduler.outbox \
|
||||
smartflow.notification.outbox \
|
||||
smartflow.taskclass-forum.outbox \
|
||||
smartflow.llm.outbox \
|
||||
smartflow.token-store.outbox
|
||||
do
|
||||
/opt/kafka/bin/kafka-topics.sh \
|
||||
--bootstrap-server kafka:9092 \
|
||||
--create \
|
||||
--if-not-exists \
|
||||
--topic "$$topic" \
|
||||
--partitions 3 \
|
||||
--replication-factor 1
|
||||
done
|
||||
|
||||
etcd:
|
||||
image: ${SMARTFLOW_ETCD_IMAGE:-quay.io/coreos/etcd:v3.5.5}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
ETCD_AUTO_COMPACTION_MODE: revision
|
||||
ETCD_AUTO_COMPACTION_RETENTION: "1000"
|
||||
ETCD_QUOTA_BACKEND_BYTES: "4294967296"
|
||||
ETCD_SNAPSHOT_COUNT: "50000"
|
||||
command: >
|
||||
etcd
|
||||
-advertise-client-urls=http://etcd:2379
|
||||
-listen-client-urls=http://0.0.0.0:2379
|
||||
--data-dir=/etcd
|
||||
volumes:
|
||||
- etcd_data:/etcd
|
||||
healthcheck:
|
||||
test: ["CMD", "etcdctl", "endpoint", "health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
minio:
|
||||
image: ${SMARTFLOW_MINIO_IMAGE:-minio/minio:RELEASE.2023-03-20T20-16-18Z}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: minioadmin
|
||||
command: minio server /minio_data --console-address ":9001"
|
||||
ports:
|
||||
- "${SMARTFLOW_MINIO_API_PORT:-9000}:9000"
|
||||
- "${SMARTFLOW_MINIO_CONSOLE_PORT:-9001}:9001"
|
||||
volumes:
|
||||
- minio_data:/minio_data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
milvus-standalone:
|
||||
image: ${SMARTFLOW_MILVUS_IMAGE:-milvusdb/milvus:v2.4.4}
|
||||
restart: unless-stopped
|
||||
command: ["milvus", "run", "standalone"]
|
||||
environment:
|
||||
ETCD_USE_EMBED: "false"
|
||||
ETCD_ENDPOINTS: etcd:2379
|
||||
MINIO_ADDRESS: minio:9000
|
||||
ports:
|
||||
- "${SMARTFLOW_MILVUS_PORT:-19530}:19530"
|
||||
- "${SMARTFLOW_MILVUS_HEALTH_PORT:-9091}:9091"
|
||||
volumes:
|
||||
- milvus_data:/var/lib/milvus
|
||||
depends_on:
|
||||
etcd:
|
||||
condition: service_healthy
|
||||
minio:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
|
||||
attu:
|
||||
image: ${SMARTFLOW_ATTU_IMAGE:-zilliz/attu:v2.4.3}
|
||||
restart: unless-stopped
|
||||
profiles: ["ops"]
|
||||
ports:
|
||||
- "${SMARTFLOW_ATTU_PORT:-8000}:3000"
|
||||
environment:
|
||||
MILVUS_URL: milvus-standalone:19530
|
||||
depends_on:
|
||||
milvus-standalone:
|
||||
condition: service_healthy
|
||||
|
||||
userauth:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/userauth"]
|
||||
|
||||
notification:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/notification"]
|
||||
|
||||
active-scheduler:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/active-scheduler"]
|
||||
|
||||
schedule:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/schedule"]
|
||||
|
||||
task:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/task"]
|
||||
|
||||
task-class:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/task-class"]
|
||||
|
||||
course:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/course"]
|
||||
|
||||
memory:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/memory"]
|
||||
|
||||
agent:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/agent"]
|
||||
|
||||
taskclassforum:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/taskclassforum"]
|
||||
|
||||
tokenstore:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/tokenstore"]
|
||||
|
||||
llm:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/llm"]
|
||||
|
||||
api:
|
||||
<<: *backend-common
|
||||
command: ["/app/bin/api"]
|
||||
ports:
|
||||
- "${SMARTFLOW_API_PORT:-8080}:8080"
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
kafka:
|
||||
condition: service_healthy
|
||||
kafka-init:
|
||||
condition: service_completed_successfully
|
||||
etcd:
|
||||
condition: service_healthy
|
||||
minio:
|
||||
condition: service_healthy
|
||||
milvus-standalone:
|
||||
condition: service_healthy
|
||||
userauth:
|
||||
condition: service_started
|
||||
notification:
|
||||
condition: service_started
|
||||
active-scheduler:
|
||||
condition: service_started
|
||||
schedule:
|
||||
condition: service_started
|
||||
task:
|
||||
condition: service_started
|
||||
task-class:
|
||||
condition: service_started
|
||||
course:
|
||||
condition: service_started
|
||||
memory:
|
||||
condition: service_started
|
||||
agent:
|
||||
condition: service_started
|
||||
taskclassforum:
|
||||
condition: service_started
|
||||
tokenstore:
|
||||
condition: service_started
|
||||
llm:
|
||||
condition: service_started
|
||||
|
||||
frontend:
|
||||
image: ${SMARTFLOW_FRONTEND_IMAGE:-smartflow/frontend:latest}
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${SMARTFLOW_FRONTEND_PORT:-80}:80"
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_started
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
redis_data:
|
||||
kafka_data:
|
||||
etcd_data:
|
||||
minio_data:
|
||||
milvus_data:
|
||||
Reference in New Issue
Block a user