From 45a594d39a3986f9368d6ac30adb8473d929c7cf Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 24 Jan 2026 18:51:45 -0800 Subject: [PATCH] fix(deploy): auto-restart services after rebuild Rebuild command now automatically restarts the service(s) to use the newly built image. Co-Authored-By: Claude Opus 4.5 --- deploy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 "镜像重新构建并重启完成" } # 启动入口