This commit is contained in:
Andras Bacsai
2023-05-02 15:20:45 +02:00
parent 53e2960ffd
commit 23cea9a130
5 changed files with 28 additions and 11 deletions

View File

@@ -23,6 +23,12 @@ class Form extends Component
{
$this->server = Server::find($this->server_id);
}
public function installDocker()
{
$config = base64_encode('{ "live-restore": true }');
runRemoteCommandSync($this->server, ["mkdir -p /etc/docker/", "touch /etc/docker/daemon.json", "echo '{$config}' | base64 -d > /etc/docker/daemon.json"]);
runRemoteCommandSync($this->server, ['sh -c "$(curl --silent -fsSL https://get.docker.com)"']);
}
public function checkConnection()
{
$this->uptime = runRemoteCommandSync($this->server, ['uptime']);

View File

@@ -123,12 +123,15 @@ class DeployApplicationJob implements ShouldQueue
$this->executeNow([
"echo 'Starting deployment of {$this->application->git_repository}:{$this->application->git_branch}...'",
"echo -n 'Pulling latest version of the builder image (ghcr.io/coollabsio/coolify-builder)... '",
"docker run --pull=always -d --name {$this->deployment_uuid} --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/coollabsio/coolify-builder",
"echo 'Done.'",
]);
$this->executeNow([
"docker run --pull=always -d --name {$this->deployment_uuid} --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/coollabsio/coolify-builder",
], isDebuggable: true);
// Import git repository
$this->executeNow([
"echo 'Done.'",
"echo -n 'Importing {$this->application->git_repository}:{$this->application->git_branch} to {$this->workdir}... '"
]);