diff --git a/backend/app/service/app_install.go b/backend/app/service/app_install.go index 23e58c2da..8063aa15c 100644 --- a/backend/app/service/app_install.go +++ b/backend/app/service/app_install.go @@ -129,7 +129,7 @@ func (a AppInstallService) Operate(req dto.AppInstallOperate) error { } install.Status = constant.Running case dto.Down: - out, err := compose.Down(dockerComposePath) + out, err := compose.Stop(dockerComposePath) if err != nil { return handleErr(install, err, out) } diff --git a/backend/utils/compose/compose.go b/backend/utils/compose/compose.go index 2362db7f2..57c5fb8ac 100644 --- a/backend/utils/compose/compose.go +++ b/backend/utils/compose/compose.go @@ -13,6 +13,12 @@ func Up(filePath string) (string, error) { } func Down(filePath string) (string, error) { + cmd := exec.Command("docker-compose", "-f", filePath, "down") + stdout, err := cmd.CombinedOutput() + return string(stdout), err +} + +func Stop(filePath string) (string, error) { cmd := exec.Command("docker-compose", "-f", filePath, "stop") stdout, err := cmd.CombinedOutput() return string(stdout), err