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
feat: image tag for services
Andras Bacsai0fbc382467f3
diff --git a/app/Http/Livewire/Project/Service/Application.php b/app/Http/Livewire/Project/Service/Application.phpindex 9bebb84e8d..44538278e7 100644--- a/app/Http/Livewire/Project/Service/Application.php+++ b/app/Http/Livewire/Project/Service/Application.php@@ -15,6 +15,7 @@ class Application extends Component'application.human_name' => 'nullable','application.description' => 'nullable','application.fqdn' => 'nullable',+ 'application.image_tag' => 'required','application.ignore_from_status' => 'required|boolean',];public function render()diff --git a/app/Http/Livewire/Project/Service/Database.php b/app/Http/Livewire/Project/Service/Database.phpindex 1a6ce772a9..36dd96d364 100644--- a/app/Http/Livewire/Project/Service/Database.php+++ b/app/Http/Livewire/Project/Service/Database.php@@ -2,7 +2,6 @@namespace App\Http\Livewire\Project\Service;-use App\Models\ServiceApplication;use App\Models\ServiceDatabase;use Livewire\Component;@@ -12,6 +11,7 @@ class Database extends Componentprotected $rules = ['database.human_name' => 'nullable','database.description' => 'nullable',+ 'database.image_tag' => 'required','database.ignore_from_status' => 'required|boolean',];diff --git a/app/Models/Service.php b/app/Models/Service.phpindex 864251260d..f6c12ccffb 100644--- a/app/Models/Service.php+++ b/app/Models/Service.php@@ -139,6 +139,7 @@ class Service extends BaseModel$image = data_get($service, 'image');if ($image) {$imageName = Str::of($image)->before(':');+ $imageTag = Str::of($image)->after(':') ?? 'latest';if (collect(DATABASE_DOCKER_IMAGES)->contains($imageName)) {$isDatabase = true;data_set($service, 'is_database', true);@@ -159,12 +160,14 @@ class Service extends BaseModelif ($isDatabase) {$savedService = ServiceDatabase::create(['name' => $serviceName,+ 'image_tag' => $imageTag,'service_id' => $this->id]);} else {$savedService = ServiceApplication::create(['name' => $serviceName,'fqdn' => $this->generateFqdn($serviceVariables, $serviceName),+ 'image_tag' => $imageTag,'service_id' => $this->id]);}@@ -182,6 +185,8 @@ class Service extends BaseModel$savedService->save();}}++ // Set image tag$fqdns = data_get($savedService, 'fqdn');if ($fqdns) {$fqdns = collect(Str::of($fqdns)->explode(','));@@ -495,6 +500,8 @@ class Service extends BaseModel$labels = $labels->merge(fqdnLabelsForTraefik($fqdns, $container_name, true));}}++data_set($service, 'labels', $labels->toArray());data_forget($service, 'is_database');data_set($service, 'restart', RESTART_MODE);diff --git a/database/migrations/2023_09_23_111811_update_service_applications_table.php b/database/migrations/2023_09_23_111811_update_service_applications_table.phpindex 9d241aec26..68ddab8d59 100644--- a/database/migrations/2023_09_23_111811_update_service_applications_table.php+++ b/database/migrations/2023_09_23_111811_update_service_applications_table.php@@ -13,6 +13,7 @@ return new class extends Migration{Schema::table('service_applications', function (Blueprint $table) {$table->boolean('ignore_from_status')->default(false);+ $table->string('image_tag')->nullable();});}@@ -23,6 +24,7 @@ return new class extends Migration{Schema::table('service_applications', function (Blueprint $table) {$table->dropColumn('ignore_from_status');+ $table->dropColumn('image_tag');});}};diff --git a/database/migrations/2023_09_23_111812_update_service_databases_table.php b/database/migrations/2023_09_23_111812_update_service_databases_table.phpindex 659cbd2a35..bcf42abfd4 100644--- a/database/migrations/2023_09_23_111812_update_service_databases_table.php+++ b/database/migrations/2023_09_23_111812_update_service_databases_table.php@@ -13,7 +13,7 @@ return new class extends Migration{Schema::table('service_databases', function (Blueprint $table) {$table->boolean('ignore_from_status')->default(false);-+ $table->string('image_tag')->nullable();});}@@ -24,6 +24,7 @@ return new class extends Migration{Schema::table('service_databases', function (Blueprint $table) {$table->dropColumn('ignore_from_status');+ $table->dropColumn('image_tag');});}};diff --git a/resources/views/livewire/project/service/application.blade.php b/resources/views/livewire/project/service/application.blade.phpindex 282995acbf..69f47fc5d3 100644--- a/resources/views/livewire/project/service/application.blade.php+++ b/resources/views/livewire/project/service/application.blade.php@@ -16,7 +16,11 @@placeholder="Human readable name"></x-forms.input><x-forms.input label="Description" id="application.description"></x-forms.input></div>- <x-forms.input placeholder="https://app.coolify.io" label="Domains" id="application.fqdn"></x-forms.input>+ <div class="flex gap-2">+ <x-forms.input placeholder="https://app.coolify.io" label="Domains"+ id="application.fqdn"></x-forms.input>+ <x-forms.input required helper="You can change the image tag 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>" label="Image Tag" id="application.image_tag"></x-forms.input>+ </div></div><h3 class="pt-2">Advanced</h3><div class="w-64">diff --git a/resources/views/livewire/project/service/database.blade.php b/resources/views/livewire/project/service/database.blade.phpindex 36f9378596..596ef3ec7d 100644--- a/resources/views/livewire/project/service/database.blade.php+++ b/resources/views/livewire/project/service/database.blade.php@@ -9,9 +9,15 @@<x-forms.button type="submit">Save</x-forms.button><a target="_blank" href="{{ $database->documentation() }}">Documentation <x-external-link /></a></div>- <div class="flex gap-2">- <x-forms.input label="Name" id="database.human_name" placeholder="Name"></x-forms.input>- <x-forms.input label="Description" id="database.description"></x-forms.input>+ <div class="flex flex-col gap-2">+ <div class="flex gap-2">+ <x-forms.input label="Name" id="database.human_name" placeholder="Name"></x-forms.input>+ <x-forms.input label="Description" id="database.description"></x-forms.input>+ </div>+ <div class="flex gap-2">+ <x-forms.input required helper="You can change the image tag 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>" label="Image Tag"+ id="database.image_tag"></x-forms.input>+ </div></div><h3 class="pt-2">Advanced</h3><div class="w-64">