diff --git a/deploy.sh b/deploy.sh index a6b99f9..455ce11 100755 --- a/deploy.sh +++ b/deploy.sh @@ -604,6 +604,10 @@ do_rebuild() { if [ "$target" = "all" ]; then log_step "重新构建所有服务镜像 (--no-cache)..." $DOCKER_COMPOSE build --no-cache + + # 重启所有后端服务 + log_step "重启所有后端服务..." + $DOCKER_COMPOSE up -d user-service payment-service knowledge-service conversation-service evolution-service else # 获取服务名 local service_name="" @@ -620,9 +624,13 @@ do_rebuild() { log_step "重新构建 $target 镜像 (--no-cache)..." $DOCKER_COMPOSE build --no-cache "$service_name" + + # 重启服务使用新镜像 + log_step "重启 $target 服务..." + $DOCKER_COMPOSE up -d "$service_name" fi - log_success "镜像重新构建完成" + log_success "镜像重新构建并重启完成" } # 启动入口