Skip to content

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.

feat: get command and output for logs from CleanupDocker

peaklabs-dev7bdef134e6da
diff --git a/app/Actions/Server/CleanupDocker.php b/app/Actions/Server/CleanupDocker.php
index 0349ead89b..ba4c2311ae 100644
--- a/app/Actions/Server/CleanupDocker.php
+++ b/app/Actions/Server/CleanupDocker.php
@@ -25,17 +25,25 @@ class CleanupDocker
"docker images --filter before=$helperImageWithVersion --filter reference=$helperImage | grep $helperImage | awk '{print $3}' | xargs -r docker rmi -f",
];
- $serverSettings = $server->settings;
- if ($serverSettings->delete_unused_volumes) {
+ if ($server->settings->delete_unused_volumes) {
$commands[] = 'docker volume prune -af';
}
- if ($serverSettings->delete_unused_networks) {
+ if ($server->settings->delete_unused_networks) {
$commands[] = 'docker network prune -f';
}
+ $cleanupLog = [];
foreach ($commands as $command) {
- instant_remote_process([$command], $server, false);
+ $commandOutput = instant_remote_process([$command], $server, false);
+ if ($commandOutput !== null) {
+ $cleanupLog[] = [
+ 'command' => $command,
+ 'output' => $commandOutput,
+ ];
+ }
}
+
+ return $cleanupLog;
}
}