diff --git a/deploy.sh b/deploy.sh index 7dbc9bc..75a6500 100755 --- a/deploy.sh +++ b/deploy.sh @@ -26,6 +26,8 @@ # payment - 支付服务 # knowledge - 知识库服务 # evolution - 进化服务 +# file - 文件服务 +# docling - Docling 文档解析服务 (Python, PDF/DOCX 表格+OCR) # kong - API网关 # postgres - PostgreSQL数据库 # redis - Redis缓存 @@ -68,6 +70,7 @@ declare -A SERVICE_PORTS=( ["knowledge"]=3003 ["evolution"]=3005 ["file"]=3006 + ["docling"]=3007 ["kong"]=8000 ["postgres"]=5432 ["redis"]=6379 @@ -96,6 +99,7 @@ declare -A DOCKER_SERVICES=( ["knowledge"]="knowledge-service" ["evolution"]="evolution-service" ["file"]="file-service" + ["docling"]="docling-service" ["web-client"]="web-client" ["admin-client"]="admin-client" ["kong"]="kong" @@ -344,6 +348,11 @@ do_build() { build_shared build_backend_service "$target" ;; + docling) + log_step "构建 docling Docker 镜像 (Python 服务,无需 Node.js 编译)..." + $DOCKER_COMPOSE build docling-service + log_success "docling 镜像构建完成" + ;; *) log_error "未知构建目标: $target" exit 1 @@ -515,7 +524,7 @@ start_backend_service_docker() { start_all_backend() { local mode=${1:-docker} - for service in user payment knowledge conversation evolution file; do + for service in user payment docling knowledge conversation evolution file; do if [ "$mode" = "docker" ]; then start_backend_service_docker "$service" else @@ -679,7 +688,7 @@ do_rebuild() { # 重启所有后端服务 log_step "重启所有后端服务..." - $DOCKER_COMPOSE up -d user-service payment-service knowledge-service conversation-service evolution-service file-service + $DOCKER_COMPOSE up -d user-service payment-service docling-service knowledge-service conversation-service evolution-service file-service # 等待服务就绪 sleep 5 @@ -696,6 +705,7 @@ do_rebuild() { conversation) service_name="conversation-service" ;; evolution) service_name="evolution-service" ;; file) service_name="file-service" ;; + docling) service_name="docling-service" ;; nginx) service_name="nginx" ;; kong) service_name="kong" ;; *) service_name="$target-service" ;; @@ -741,7 +751,7 @@ do_start() { postgres|redis|neo4j) $DOCKER_COMPOSE up -d "$target" ;; - conversation|user|payment|knowledge|evolution|file) + conversation|user|payment|knowledge|evolution|file|docling) if [ "$mode" = "docker" ]; then start_backend_service_docker "$target" else @@ -803,7 +813,7 @@ stop_all() { if [ "$mode" = "docker" ]; then $DOCKER_COMPOSE down else - for service in conversation user payment knowledge evolution file; do + for service in conversation user payment knowledge evolution file docling; do stop_service_local "$service" done $DOCKER_COMPOSE down @@ -824,7 +834,7 @@ do_stop() { infra|infrastructure) $DOCKER_COMPOSE stop postgres redis neo4j ;; - conversation|user|payment|knowledge|evolution|file) + conversation|user|payment|knowledge|evolution|file|docling) if [ "$mode" = "docker" ]; then stop_service_docker "$target" else @@ -1675,18 +1685,18 @@ show_help() { build [target] 编译构建 target: all, shared, backend, frontend, conversation, user, payment, knowledge, evolution, - web-client, admin-client + file, docling, web-client, admin-client rebuild [target] [--no-cache] 重新构建 Docker 镜像并重启服务 target: all, conversation, user, payment, knowledge, evolution, - nginx, kong + file, docling, nginx, kong --no-cache: 可选,忽略缓存完全重新构建 start [target] [mode] 启动服务 target: all, infra, kong, nginx, backend, conversation, user, payment, knowledge, evolution, - postgres, redis, neo4j + file, docling, postgres, redis, neo4j mode: docker (默认), local stop [target] [mode] 停止服务 @@ -1747,6 +1757,7 @@ show_help() { ./deploy.sh full-reset # ⚠️ 重置所有数据库数据 ./deploy.sh nuke # ☢️ 彻底删除所有Docker资源 ./deploy.sh rebuild conversation # 重新构建对话服务镜像 (使用缓存) + ./deploy.sh rebuild docling # 重新构建 Docling 文档解析服务 ./deploy.sh rebuild conversation --no-cache # 完全重新构建 (忽略缓存) ./deploy.sh db init # 初始化数据库 (首次部署) ./deploy.sh db backup # 备份数据库