fix(docker): log docker stop command only in local development

Log the generated docker stop command and Docker version when
running locally so developers can inspect version-aware flags.
Skip logging outside local development.
This commit is contained in:
Andras Bacsai
2026-08-13 11:24:08 +02:00
parent e79230cf37
commit 47c0080d3b
2 changed files with 33 additions and 1 deletions
+11 -1
View File
@@ -7,6 +7,7 @@ use App\Models\Server;
use App\Models\ServiceApplication;
use App\Support\ValidationPatterns;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Spatie\Url\Url;
use Symfony\Component\Yaml\Yaml;
@@ -251,7 +252,16 @@ function dockerStopCommand(int $timeout, string $containers, Server|string|null
? "--timeout={$timeout}"
: "--time={$timeout}";
return "docker stop {$flag} {$containers}";
$command = "docker stop {$flag} {$containers}";
if (app()->bound('config') && isDev()) {
Log::info('docker stop command', [
'command' => $command,
'docker_version' => $version,
]);
}
return $command;
}
function escapeShellValue(string $value): string
{