mirror of
https://github.com/coollabsio/coolify.git
synced 2026-09-28 02:06:37 -04:00
fix(docker): preserve restart policies when stopping containers
This commit is contained in:
@@ -44,8 +44,6 @@ class StopApplication
|
||||
$commands = [dockerStopCommand($timeout, $containerName, $server)];
|
||||
if ($removeContainers) {
|
||||
$commands[] = "docker rm -f $containerName";
|
||||
} else {
|
||||
array_unshift($commands, "docker update --restart=no $containerName");
|
||||
}
|
||||
|
||||
instant_remote_process(command: $commands, server: $server, throwError: false);
|
||||
|
||||
@@ -20,8 +20,6 @@ class StopApplicationPreview
|
||||
$commands = [dockerStopCommand($application->settings->stopGracePeriodSeconds(), $containerName, $server)];
|
||||
if ($removeContainer) {
|
||||
$commands[] = "docker rm -f $containerName";
|
||||
} else {
|
||||
array_unshift($commands, "docker update --restart=no $containerName");
|
||||
}
|
||||
instant_remote_process($commands, $server, false);
|
||||
}
|
||||
|
||||
@@ -62,8 +62,6 @@ class StopDatabase
|
||||
$commands = [dockerStopCommand($timeout, $containerName, $server)];
|
||||
if ($removeContainer) {
|
||||
$commands[] = "docker rm -f $containerName";
|
||||
} else {
|
||||
array_unshift($commands, "docker update --restart=no $containerName");
|
||||
}
|
||||
instant_remote_process(command: $commands, server: $server, throwError: false);
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@ class StopServiceApplication
|
||||
if ($removeContainer) {
|
||||
$commands = ["docker rm -f {$containerName}"];
|
||||
} else {
|
||||
$commands = [
|
||||
"docker update --restart=no {$containerName}",
|
||||
"docker stop {$containerName}",
|
||||
];
|
||||
$commands = ["docker stop {$containerName}"];
|
||||
}
|
||||
instant_remote_process($commands, $server, throwError: ! $removeContainer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user