An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: service deletion fix
Andras Bacsai73d09487342f
diff --git a/app/Actions/Service/DeleteService.php b/app/Actions/Service/DeleteService.phpindex 743158c2df..a70adfecf6 100644--- a/app/Actions/Service/DeleteService.php+++ b/app/Actions/Service/DeleteService.php@@ -10,36 +10,43 @@ class DeleteServiceuse AsAction;public function handle(Service $service){- $server = data_get($service, 'server');- if ($server->isFunctional()) {- StopService::run($service);- }- $storagesToDelete = collect([]);+ try {+ $server = data_get($service, 'server');+ if ($server->isFunctional()) {+ StopService::run($service);+ $storagesToDelete = collect([]);++ $service->environment_variables()->delete();+ $commands = [];+ foreach ($service->applications()->get() as $application) {+ $storages = $application->persistentStorages()->get();+ foreach ($storages as $storage) {+ $storagesToDelete->push($storage);+ }+ }+ foreach ($service->databases()->get() as $database) {+ $storages = $database->persistentStorages()->get();+ foreach ($storages as $storage) {+ $storagesToDelete->push($storage);+ }+ }+ foreach ($storagesToDelete as $storage) {+ $commands[] = "docker volume rm -f $storage->name";+ }+ $commands[] = "docker rm -f $service->uuid";- $service->environment_variables()->delete();- $commands = [];- foreach ($service->applications()->get() as $application) {- $storages = $application->persistentStorages()->get();- foreach ($storages as $storage) {- $storagesToDelete->push($storage);+ instant_remote_process($commands, $server, false);}- $application->forceDelete();- }- foreach ($service->databases()->get() as $database) {- $storages = $database->persistentStorages()->get();- foreach ($storages as $storage) {- $storagesToDelete->push($storage);+ } catch (\Exception $e) {+ throw new \Exception($e->getMessage());+ } finally {+ foreach ($service->applications()->get() as $application) {+ $application->forceDelete();}- $database->forceDelete();- }- if ($server->isFunctional()) {- foreach ($storagesToDelete as $storage) {- $commands[] = "docker volume rm -f $storage->name";+ foreach ($service->databases()->get() as $database) {+ $database->forceDelete();}- $commands[] = "docker rm -f $service->uuid";-- instant_remote_process($commands, $server, false);+ $service->forceDelete();}- $service->forceDelete();}}