fix: remove volumes as well

This commit is contained in:
Andras Bacsai 2024-07-11 11:30:20 +02:00
parent e63e806572
commit f2d82e16d6
2 changed files with 11 additions and 2 deletions

View File

@ -39,9 +39,13 @@ public function handle(Application $application)
}
}
if ($application->build_pack === 'dockercompose') {
// remove network
$uuid = $application->uuid;
instant_remote_process(["docker network disconnect {$uuid} coolify-proxy"], $server);
instant_remote_process(["docker network rm {$uuid}"], $server);
instant_remote_process(["docker network disconnect {$uuid} coolify-proxy"], $server, false);
instant_remote_process(["docker network rm {$uuid}"], $server, false);
// remove volumes
instant_remote_process(["cd {$application->dirOnServer()} && docker compose down -v"], $server, false);
}
}
}

View File

@ -778,6 +778,11 @@ public function generateBaseDir(string $uuid)
return "/artifacts/{$uuid}";
}
public function dirOnServer()
{
return application_configuration_dir()."/{$this->uuid}";
}
public function setGitImportSettings(string $deployment_uuid, string $git_clone_command, bool $public = false)
{
$baseDir = $this->generateBaseDir($deployment_uuid);