wip
This commit is contained in:
parent
53e2960ffd
commit
23cea9a130
@ -23,6 +23,12 @@ class Form extends Component
|
|||||||
{
|
{
|
||||||
$this->server = Server::find($this->server_id);
|
$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()
|
public function checkConnection()
|
||||||
{
|
{
|
||||||
$this->uptime = runRemoteCommandSync($this->server, ['uptime']);
|
$this->uptime = runRemoteCommandSync($this->server, ['uptime']);
|
||||||
|
@ -123,12 +123,15 @@ class DeployApplicationJob implements ShouldQueue
|
|||||||
$this->executeNow([
|
$this->executeNow([
|
||||||
"echo 'Starting deployment of {$this->application->git_repository}:{$this->application->git_branch}...'",
|
"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)... '",
|
"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
|
// Import git repository
|
||||||
$this->executeNow([
|
$this->executeNow([
|
||||||
|
"echo 'Done.'",
|
||||||
"echo -n 'Importing {$this->application->git_repository}:{$this->application->git_branch} to {$this->workdir}... '"
|
"echo -n 'Importing {$this->application->git_repository}:{$this->application->git_branch} to {$this->workdir}... '"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ if (!function_exists('runRemoteCommandSync')) {
|
|||||||
if (!$throwError) {
|
if (!$throwError) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Log::error($output);
|
Log::error($process->errorOutput());
|
||||||
throw new \RuntimeException('There was an error running the command.');
|
throw new \RuntimeException('There was an error running the command.');
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
|
@ -4,11 +4,11 @@ ARG TARGETPLATFORM
|
|||||||
# https://download.docker.com/linux/static/stable/
|
# https://download.docker.com/linux/static/stable/
|
||||||
ARG DOCKER_VERSION=23.0.5
|
ARG DOCKER_VERSION=23.0.5
|
||||||
# https://github.com/docker/compose/releases
|
# 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 now
|
|
||||||
ARG DOCKER_COMPOSE_VERSION=2.17.3
|
ARG 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
|
# https://github.com/buildpacks/pack/releases
|
||||||
ARG PACK_VERSION=0.27.0
|
ARG PACK_VERSION=0.29.0
|
||||||
# https://github.com/railwayapp/nixpacks/releases
|
# https://github.com/railwayapp/nixpacks/releases
|
||||||
ARG NIXPACKS_VERSION=1.6.1
|
ARG NIXPACKS_VERSION=1.6.1
|
||||||
|
|
||||||
@ -16,11 +16,18 @@ USER root
|
|||||||
WORKDIR /artifacts
|
WORKDIR /artifacts
|
||||||
RUN apk add --no-cache bash curl git git-lfs openssh-client tar tini
|
RUN apk add --no-cache bash curl git git-lfs openssh-client tar tini
|
||||||
RUN mkdir -p ~/.docker/cli-plugins
|
RUN mkdir -p ~/.docker/cli-plugins
|
||||||
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-$DOCKER_VERSION -o /usr/bin/docker
|
RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]]; then \
|
||||||
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-$DOCKER_COMPOSE_VERSION -o ~/.docker/cli-plugins/docker-compose
|
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 && \
|
||||||
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/pack-$PACK_VERSION -o /usr/local/bin/pack
|
curl -SL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}}/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose && \
|
||||||
RUN curl -sSL https://nixpacks.com/install.sh | bash
|
(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) && \
|
||||||
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/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/pack
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
ENTRYPOINT ["/sbin/tini", "--"]
|
||||||
CMD ["sh", "-c", "while true; do sleep 3600; done"]
|
CMD ["sh", "-c", "while true; do sleep 3600; done"]
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
Submit
|
Submit
|
||||||
</button>
|
</button>
|
||||||
<button wire:click.prevent='checkConnection'>Check Connection</button>
|
<button wire:click.prevent='checkConnection'>Check Connection</button>
|
||||||
|
<button wire:click.prevent='installDocker'>Install Docker</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@isset($uptime)
|
@isset($uptime)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user