fix(updater): 复用原 Compose 项目名并保护非 Compose 部署

This commit is contained in:
2026-09-28 11:24:51 +08:00
parent f63c28e10e
commit 4e948f65d1
8 changed files with 41 additions and 4 deletions
+2 -2
View File
@@ -323,7 +323,7 @@ func (s *Server) compose(ctx context.Context, version string, args ...string) (s
if plan.helper {
return s.composeViaHelper(ctx, plan, version, args...)
}
fullArgs := append([]string{"compose", "-f", plan.containerCompose}, args...)
fullArgs := append([]string{"compose", "--project-name", plan.projectName, "-f", plan.containerCompose}, args...)
env := []string{"FONU_VERSION=" + version}
return runCommand(ctx, s.cfg.ProjectDir, env, "docker", fullArgs...)
}
@@ -340,7 +340,7 @@ func (s *Server) composeViaHelper(ctx context.Context, plan composePlan, version
"-w", "/workspace",
"-e", "FONU_VERSION=" + version,
image,
"compose", "-f", plan.helperComposePath,
"compose", "--project-name", plan.projectName, "-f", plan.helperComposePath,
}
helperArgs = append(helperArgs, args...)
return runCommand(ctx, "", nil, "docker", helperArgs...)