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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
wip
Andras Bacsai23cea9a13064
diff --git a/app/Http/Livewire/Server/Form.php b/app/Http/Livewire/Server/Form.phpindex 2d9a6cf604..7b512f0661 100644--- a/app/Http/Livewire/Server/Form.php+++ b/app/Http/Livewire/Server/Form.php@@ -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']);diff --git a/app/Jobs/DeployApplicationJob.php b/app/Jobs/DeployApplicationJob.phpindex 7fdd48190e..9a4393f7c2 100644--- a/app/Jobs/DeployApplicationJob.php+++ b/app/Jobs/DeployApplicationJob.php@@ -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}... '"]);diff --git a/bootstrap/helpers.php b/bootstrap/helpers.phpindex 830df31c5e..7e86b016cc 100644--- a/bootstrap/helpers.php+++ b/bootstrap/helpers.php@@ -131,7 +131,7 @@ if (!function_exists('runRemoteCommandSync')) {if (!$throwError) {return false;}- Log::error($output);+ Log::error($process->errorOutput());throw new \RuntimeException('There was an error running the command.');}return $output;diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfileindex aa7e9de1e8..868c48cd33 100644--- a/docker/builder/Dockerfile+++ b/docker/builder/Dockerfile@@ -4,11 +4,11 @@ ARG TARGETPLATFORM# https://download.docker.com/linux/static/stable/ARG DOCKER_VERSION=23.0.5# https://github.com/docker/compose/releases-# Reverted to 2.6.1 because of this https://github.com/docker/compose/issues/9704. 2.9.0 still has a bug.-# Using the latest nowARG DOCKER_COMPOSE_VERSION=2.17.3+# https://github.com/docker/buildx/releases+ARG DOCKER_BUILDX_VERSION=0.10.4# https://github.com/buildpacks/pack/releases-ARG PACK_VERSION=0.27.0+ARG PACK_VERSION=0.29.0# https://github.com/railwayapp/nixpacks/releasesARG NIXPACKS_VERSION=1.6.1@@ -16,11 +16,18 @@ USER rootWORKDIR /artifactsRUN apk add --no-cache bash curl git git-lfs openssh-client tar tiniRUN mkdir -p ~/.docker/cli-plugins-RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-$DOCKER_VERSION -o /usr/bin/docker-RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-$DOCKER_COMPOSE_VERSION -o ~/.docker/cli-plugins/docker-compose-RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/pack-$PACK_VERSION -o /usr/local/bin/pack-RUN curl -sSL https://nixpacks.com/install.sh | bash-RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack+RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]]; then \+ curl -SL https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v0.10.4.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx && \+ curl -SL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}}/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose && \+ (curl -sSL "https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" | sudo tar -C /usr/local/bin/ --no-same-owner -xzv pack) && \+ curl -sSL https://nixpacks.com/install.sh | bash && \+ chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack; \+ fi+# RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-$DOCKER_VERSION -o /usr/bin/docker+# RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-$DOCKER_COMPOSE_VERSION -o ~/.docker/cli-plugins/docker-compose+# RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/pack-$PACK_VERSION -o /usr/local/bin/pack+# RUN curl -sSL https://nixpacks.com/install.sh | bash+# RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/packENTRYPOINT ["/sbin/tini", "--"]CMD ["sh", "-c", "while true; do sleep 3600; done"]diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.phpindex 1226bf3f83..15ead9a790 100644--- a/resources/views/livewire/server/form.blade.php+++ b/resources/views/livewire/server/form.blade.php@@ -22,6 +22,7 @@Submit</button><button wire:click.prevent='checkConnection'>Check Connection</button>+ <button wire:click.prevent='installDocker'>Install Docker</button></div></form>@isset($uptime)