only stop containers, do not kill them

This commit is contained in:
Andras Bacsai
2023-04-14 11:24:58 +02:00
parent 4ecf1edb25
commit 14be2c1ebf
3 changed files with 75 additions and 56 deletions

View File

@@ -32,7 +32,7 @@ class DeployApplication extends Component
}
public function deploy()
public function start()
{
// Create Deployment ID
$this->deployment_uuid = new Cuid2(7);
@@ -49,8 +49,8 @@ class DeployApplication extends Component
public function stop()
{
runRemoteCommandSync($this->destination->server, ["docker rm -f {$this->application_uuid} >/dev/null 2>&1"]);
$this->application->status = 'exited';
runRemoteCommandSync($this->destination->server, ["docker stop -t 0 {$this->application_uuid} >/dev/null 2>&1"]);
$this->application->status = 'stopped';
$this->application->save();
}