feat(deploy): add docling service support to deploy.sh

Add docling (Python document parsing service) to all deploy.sh operations:
- SERVICE_PORTS, DOCKER_SERVICES maps
- build, rebuild, start, stop, restart commands
- start_all_backend (ordered before knowledge-service, which depends on it)
- Help text and examples updated

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-07 05:34:23 -08:00
parent 57d21526a5
commit 0985214ab7
1 changed files with 19 additions and 8 deletions

View File

@ -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 # 备份数据库