Compare commits

...

11 Commits

Author SHA1 Message Date
Andras Bacsai
ba7148206a Merge pull request #1336 from coollabsio/next
v4.0.0-beta.91
2023-10-17 15:41:30 +02:00
Andras Bacsai
59c5b22e6c fix: always start proxy if not NONE is selected 2023-10-17 15:40:47 +02:00
Andras Bacsai
be7f2ad9c4 ui: add helper to service domains 2023-10-17 15:34:20 +02:00
Andras Bacsai
62295ef573 Merge pull request #1335 from coollabsio/next
v4.0.0-beta.90
2023-10-17 14:45:26 +02:00
Andras Bacsai
ceb9fcf3b6 service: wordpress 2023-10-17 14:44:25 +02:00
Andras Bacsai
60282f7b6c fix: only include config.json if its exists and a file 2023-10-17 14:23:07 +02:00
Andras Bacsai
f14b0a3411 Merge pull request #1334 from coollabsio/next
v4.0.0-beta.89
2023-10-17 14:06:12 +02:00
Andras Bacsai
30af317bd9 fix: show docker build logs 2023-10-17 14:04:21 +02:00
Andras Bacsai
95faa1c3ad fix: noindex meta tag 2023-10-17 13:28:33 +02:00
Andras Bacsai
fb280afe41 Merge pull request #1332 from coollabsio/next
v4.0.0-beta.88
2023-10-17 12:41:45 +02:00
Andras Bacsai
fd488a561a feat: use docker login credentials from server 2023-10-17 12:35:04 +02:00
9 changed files with 53 additions and 25 deletions

View File

@@ -87,7 +87,7 @@ class StartDatabaseProxy
"echo '{$dockerfile_base64}' | base64 -d > $configuration_dir/Dockerfile",
"echo '{$nginxconf_base64}' | base64 -d > $configuration_dir/nginx.conf",
"echo '{$dockercompose_base64}' | base64 -d > $configuration_dir/docker-compose.yaml",
"docker compose --project-directory {$configuration_dir} up --build -d >/dev/null",
"docker compose --project-directory {$configuration_dir} up --build -d",
], $database->destination->server);
}
}

View File

@@ -71,6 +71,10 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
private $log_model;
private Collection $saved_outputs;
private string $serverUser = 'root';
private string $serverUserHomeDir = '/root';
private string $dockerConfigFileExists = 'NOK';
public $tries = 1;
public function __construct(int $application_deployment_queue_id)
{
@@ -92,7 +96,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
}
$this->destination = $this->application->destination->getMorphClass()::where('id', $this->application->destination->id)->first();
$this->server = $this->destination->server;
$this->serverUser = $this->server->user;
$this->basedir = "/artifacts/{$this->deployment_uuid}";
$this->workdir = "{$this->basedir}" . rtrim($this->application->base_directory, '/');
$this->configuration_dir = application_configuration_dir() . "/{$this->application->uuid}";
@@ -160,6 +164,10 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
return "--add-host $name:$ip";
})->implode(' ');
// Get user home directory
$this->serverUserHomeDir = instant_remote_process(["echo \$HOME"], $this->server);
ray("test -f {$this->serverUserHomeDir}/.docker/config.json && echo 'OK' || echo 'NOK'");
$this->dockerConfigFileExists = instant_remote_process(["test -f {$this->serverUserHomeDir}/.docker/config.json && echo 'OK' || echo 'NOK'"], $this->server);
try {
if ($this->application->dockerfile) {
$this->deploy_simple_dockerfile();
@@ -450,7 +458,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$this->stop_running_container();
$this->execute_remote_command(
["echo -n 'Starting preview deployment.'"],
[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up -d >/dev/null"), "hidden" => true],
[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up -d"), "hidden" => true],
);
}
@@ -458,7 +466,11 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
{
$pull = "--pull=always";
$helperImage = config('coolify.helper_image');
$runCommand = "docker run {$pull} -d --network {$this->destination->network} -v /:/host --name {$this->deployment_uuid} --rm -v /var/run/docker.sock:/var/run/docker.sock {$helperImage}";
if ($this->dockerConfigFileExists === 'OK') {
$runCommand = "docker run {$pull} -d --network {$this->destination->network} -v /:/host --name {$this->deployment_uuid} --rm -v {$this->serverUserHomeDir}/.docker/config.json:/root/.docker/config.json:ro -v /var/run/docker.sock:/var/run/docker.sock {$helperImage}";
} else {
$runCommand = "docker run {$pull} -d --network {$this->destination->network} -v /:/host --name {$this->deployment_uuid} --rm -v /var/run/docker.sock:/var/run/docker.sock {$helperImage}";
}
$this->execute_remote_command(
[
@@ -825,7 +837,6 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
]
);
} else {
ray("docker build $this->addHosts --network host -f {$this->workdir}{$this->dockerfile_location} {$this->build_args} --progress plain -t $this->production_image_name {$this->workdir}");
$this->execute_remote_command([
executeInDocker($this->deployment_uuid, "docker build $this->addHosts --network host -f {$this->workdir}{$this->dockerfile_location} {$this->build_args} --progress plain -t $this->production_image_name {$this->workdir}"), "hidden" => true
]);
@@ -853,7 +864,7 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
{
$this->execute_remote_command(
["echo -n 'Starting application (could take a while).'"],
[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up --build -d >/dev/null"), "hidden" => true],
[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up --build -d"), "hidden" => true],
);
}

View File

@@ -193,23 +193,24 @@ class Server extends BaseModel
}
public function isProxyShouldRun()
{
$shouldRun = false;
if ($this->proxyType() === ProxyTypes::NONE->value) {
return false;
}
foreach ($this->applications() as $application) {
if (data_get($application, 'fqdn')) {
$shouldRun = true;
break;
}
}
if ($this->id === 0) {
$settings = InstanceSettings::get();
if (data_get($settings, 'fqdn')) {
$shouldRun = true;
}
}
return $shouldRun;
// foreach ($this->applications() as $application) {
// if (data_get($application, 'fqdn')) {
// $shouldRun = true;
// break;
// }
// }
// ray($this->services()->get());
// if ($this->id === 0) {
// $settings = InstanceSettings::get();
// if (data_get($settings, 'fqdn')) {
// $shouldRun = true;
// }
// }
return true;
}
public function isFunctional()
{

View File

@@ -7,7 +7,7 @@ return [
// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.87',
'release' => '4.0.0-beta.91',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),

View File

@@ -1,3 +1,3 @@
<?php
return '4.0.0-beta.87';
return '4.0.0-beta.91';

View File

@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://api.fonts.coollabs.io" crossorigin>
<link href="https://api.fonts.coollabs.io/css2?family=Inter&display=swap" rel="stylesheet">
<meta name="robots" content="noindex">
<title>Coolify</title>
@env('local')
<link rel="icon" href="{{ asset('favicon-dev.png') }}" type="image/x-icon" />

View File

@@ -18,10 +18,10 @@
<div class="flex gap-2">
@if ($application->required_fqdn)
<x-forms.input required placeholder="https://app.coolify.io" label="Domains"
id="application.fqdn"></x-forms.input>
id="application.fqdn" helper="You can specify one domain with path or more with comma. You can specify a port to bind the domain to.<br><br><span class='text-helper'>Example</span><br>- http://app.coolify.io, https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3<br>- http://app.coolify.io:3000 -> app.coolify.io will point to port 3000 inside the container. "></x-forms.input>
@else
<x-forms.input placeholder="https://app.coolify.io" label="Domains"
id="application.fqdn"></x-forms.input>
id="application.fqdn" helper="You can specify one domain with path or more with comma. You can specify a port to bind the domain to.<br><br><span class='text-helper'>Example</span><br>- http://app.coolify.io, https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3<br>- http://app.coolify.io:3000 -> app.coolify.io will point to port 3000 inside the container. "></x-forms.input>
@endif
<x-forms.input required
helper="You can change the image you would like to deploy.<br><br><span class='text-warning'>WARNING. You could corrupt your data. Only do it if you know what you are doing.</span>"

View File

@@ -29,5 +29,20 @@
"documentation": "https://github.com/louislam/uptime-kuma/wiki",
"slogan": "Uptime Kuma is a free, self-hosted monitoring tool for tracking the status and performance of your web services and applications in real-time.",
"compose": "c2VydmljZXM6CiAgdXB0aW1lLWt1bWE6CiAgICBpbWFnZTogbG91aXNsYW0vdXB0aW1lLWt1bWE6MQogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gU0VSVklDRV9GUUROCiAgICB2b2x1bWVzOgogICAgICAtIHVwdGltZS1rdW1hOi9hcHAvZGF0YQogICAgaGVhbHRoY2hlY2s6CiAgICAgIHRlc3Q6IFsiQ01ELVNIRUxMIiwgImV4dHJhL2hlYWx0aGNoZWNrIl0KICAgICAgaW50ZXJ2YWw6IDJzCiAgICAgIHRpbWVvdXQ6IDEwcwogICAgICByZXRyaWVzOiAxNQ=="
},
"wordpress-with-mariadb": {
"documentation": "https://wordpress.org/documentation/",
"slogan": "Wordpress is a free and open-source content management system (CMS) written in PHP and paired with a MySQL or MariaDB database.",
"compose": "c2VydmljZXM6CiAgIHdvcmRwcmVzczoKICAgICBpbWFnZTogd29yZHByZXNzOmxhdGVzdAogICAgIHZvbHVtZXM6CiAgICAgICAtIHdvcmRwcmVzcy1maWxlczovdmFyL3d3dy9odG1sCiAgICAgZW52aXJvbm1lbnQ6CiAgICAgICBTRVJWSUNFX0ZRRE46CiAgICAgICBXT1JEUFJFU1NfREJfSE9TVDogbWFyaWFkYgogICAgICAgV09SRFBSRVNTX0RCX1VTRVI6ICRTRVJWSUNFX1VTRVJfV09SRFBSRVNTCiAgICAgICBXT1JEUFJFU1NfREJfUEFTU1dPUkQ6ICRTRVJWSUNFX1BBU1NXT1JEX1dPUkRQUkVTUwogICAgICAgV09SRFBSRVNTX0RCX05BTUU6IHdvcmRwcmVzcwogICAgIGRlcGVuZHNfb246CiAgICAgICAtIG1hcmlhZGIKCiAgIG1hcmlhZGI6CiAgICAgaW1hZ2U6IG1hcmlhZGI6MTEKICAgICB2b2x1bWVzOgogICAgICAgLSBtYXJpYWRiLWRhdGE6L3Zhci9saWIvbXlzcWwKICAgICBlbnZpcm9ubWVudDoKICAgICAgIE1ZU1FMX1JPT1RfUEFTU1dPUkQ6ICRTRVJWSUNFX1BBU1NXT1JEX1JPT1QKICAgICAgIE1ZU1FMX0RBVEFCQVNFOiB3b3JkcHJlc3MKICAgICAgIE1ZU1FMX1VTRVI6ICRTRVJWSUNFX1VTRVJfV09SRFBSRVNTCiAgICAgICBNWVNRTF9QQVNTV09SRDogJFNFUlZJQ0VfUEFTU1dPUkRfV09SRFBSRVNT"
},
"wordpress-with-mysql": {
"documentation": "https://wordpress.org/documentation/",
"slogan": "Wordpress with MySQL.",
"compose": "c2VydmljZXM6CiAgIHdvcmRwcmVzczoKICAgICBpbWFnZTogd29yZHByZXNzOmxhdGVzdAogICAgIHZvbHVtZXM6CiAgICAgICAtIHdvcmRwcmVzcy1maWxlczovdmFyL3d3dy9odG1sCiAgICAgZW52aXJvbm1lbnQ6CiAgICAgICBTRVJWSUNFX0ZRRE46CiAgICAgICBXT1JEUFJFU1NfREJfSE9TVDogbXlzcWwKICAgICAgIFdPUkRQUkVTU19EQl9VU0VSOiAkU0VSVklDRV9VU0VSX1dPUkRQUkVTUwogICAgICAgV09SRFBSRVNTX0RCX1BBU1NXT1JEOiAkU0VSVklDRV9QQVNTV09SRF9XT1JEUFJFU1MKICAgICAgIFdPUkRQUkVTU19EQl9OQU1FOiB3b3JkcHJlc3MKICAgICBkZXBlbmRzX29uOgogICAgICAgLSBteXNxbAoKICAgbXlzcWw6CiAgICAgaW1hZ2U6IG15c3FsOjUuNwogICAgIHZvbHVtZXM6CiAgICAgICAtIG15c3FsLWRhdGE6L3Zhci9saWIvbXlzcWwKICAgICBlbnZpcm9ubWVudDoKICAgICAgIE1ZU1FMX1JPT1RfUEFTU1dPUkQ6ICRTRVJWSUNFX1BBU1NXT1JEX1JPT1QKICAgICAgIE1ZU1FMX0RBVEFCQVNFOiB3b3JkcHJlc3MKICAgICAgIE1ZU1FMX1VTRVI6ICRTRVJWSUNFX1VTRVJfV09SRFBSRVNTCiAgICAgICBNWVNRTF9QQVNTV09SRDogJFNFUlZJQ0VfUEFTU1dPUkRfV09SRFBSRVNT"
},
"wordpress-without-database": {
"documentation": "https://wordpress.org/documentation/",
"slogan": "Wordpress without predefined database.",
"compose": "c2VydmljZXM6CiAgIHdvcmRwcmVzczoKICAgICBpbWFnZTogd29yZHByZXNzOmxhdGVzdAogICAgIHZvbHVtZXM6CiAgICAgICAtIHdvcmRwcmVzcy1maWxlczovdmFyL3d3dy9odG1sCiAgICAgZW52aXJvbm1lbnQ6CiAgICAgICBTRVJWSUNFX0ZRRE46CiAgICA="
}
}

View File

@@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.87"
"version": "4.0.0-beta.91"
}
}
}