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
remove unnecessary things from application table
Andras Bacsai0964c7a3387b
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.phpindex 38eb4dce84..48be897143 100644--- a/app/Livewire/Project/Application/General.php+++ b/app/Livewire/Project/Application/General.php@@ -40,8 +40,6 @@ class General extends Componentpublic ?string $initialDockerComposeLocation = null;- public ?string $initialDockerComposePrLocation = null;-public ?Collection $parsedServices;public $parsedServiceDomains = [];@@ -72,11 +70,8 @@ class General extends Component'application.docker_registry_image_tag' => 'nullable','application.dockerfile_location' => 'nullable','application.docker_compose_location' => 'nullable',- 'application.docker_compose_pr_location' => 'nullable','application.docker_compose' => 'nullable',- 'application.docker_compose_pr' => 'nullable','application.docker_compose_raw' => 'nullable',- 'application.docker_compose_pr_raw' => 'nullable','application.dockerfile_target_build' => 'nullable','application.docker_compose_custom_start_command' => 'nullable','application.docker_compose_custom_build_command' => 'nullable',@@ -114,11 +109,8 @@ class General extends Component'application.docker_registry_image_tag' => 'Docker registry image tag','application.dockerfile_location' => 'Dockerfile location','application.docker_compose_location' => 'Docker compose location',- 'application.docker_compose_pr_location' => 'Docker compose location','application.docker_compose' => 'Docker compose',- 'application.docker_compose_pr' => 'Docker compose','application.docker_compose_raw' => 'Docker compose raw',- 'application.docker_compose_pr_raw' => 'Docker compose raw','application.custom_labels' => 'Custom labels','application.dockerfile_target_build' => 'Dockerfile target build','application.custom_docker_run_options' => 'Custom docker run commands',@@ -183,7 +175,7 @@ class General extends Componentif ($isInit && $this->application->docker_compose_raw) {return;}- ['parsedServices' => $this->parsedServices, 'initialDockerComposeLocation' => $this->initialDockerComposeLocation, 'initialDockerComposePrLocation' => $this->initialDockerComposePrLocation] = $this->application->loadComposeFile($isInit);+ ['parsedServices' => $this->parsedServices, 'initialDockerComposeLocation' => $this->initialDockerComposeLocation] = $this->application->loadComposeFile($isInit);if (is_null($this->parsedServices)) {$this->dispatch('error', 'Failed to parse your docker-compose file. Please check the syntax and try again.');@@ -222,7 +214,6 @@ class General extends Component$this->dispatch('refreshEnvs');} catch (\Throwable $e) {$this->application->docker_compose_location = $this->initialDockerComposeLocation;- $this->application->docker_compose_pr_location = $this->initialDockerComposePrLocation;$this->application->save();return handleError($e, $this);diff --git a/app/Models/Application.php b/app/Models/Application.phpindex 9c27fc9382..98b79549f1 100644--- a/app/Models/Application.php+++ b/app/Models/Application.php@@ -964,11 +964,7 @@ class Application extends BaseModel['commands' => $cloneCommand] = $this->generateGitImportCommands(deployment_uuid: $uuid, only_checkout: true, exec_in_docker: false, custom_base_dir: '.');$workdir = rtrim($this->base_directory, '/');$composeFile = $this->docker_compose_location;- // $prComposeFile = $this->docker_compose_pr_location;$fileList = collect([".$workdir$composeFile"]);- // if ($composeFile !== $prComposeFile) {- // $fileList->push(".$prComposeFile");- // }$commands = collect(["rm -rf /tmp/{$uuid}","mkdir -p /tmp/{$uuid}",@@ -1017,7 +1013,6 @@ class Application extends BaseModelreturn ['parsedServices' => $parsedServices,'initialDockerComposeLocation' => $this->docker_compose_location,- 'initialDockerComposePrLocation' => $this->docker_compose_pr_location,];}diff --git a/database/migrations/2024_06_25_184323_remove_docker_compose_pr.php b/database/migrations/2024_06_25_184323_remove_docker_compose_pr.phpnew file mode 100644index 0000000000..819a3b3f5d--- /dev/null+++ b/database/migrations/2024_06_25_184323_remove_docker_compose_pr.php@@ -0,0 +1,32 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ /**+ * Run the migrations.+ */+ public function up(): void+ {+ Schema::table('applications', function (Blueprint $table) {+ $table->dropColumn('docker_compose_pr_location');+ $table->dropColumn('docker_compose_pr');+ $table->dropColumn('docker_compose_pr_raw');+ });+ }++ /**+ * Reverse the migrations.+ */+ public function down(): void+ {+ Schema::table('applications', function (Blueprint $table) {+ $table->string('docker_compose_pr_location')->nullable()->default('/docker-compose.yaml')->after('docker_compose_location');+ $table->longText('docker_compose_pr')->nullable()->after('docker_compose_location');+ $table->longText('docker_compose_pr_raw')->nullable()->after('docker_compose');+ });+ }+};diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.phpindex c19a9c7e8c..42742a863f 100644--- a/resources/views/livewire/project/application/general.blade.php+++ b/resources/views/livewire/project/application/general.blade.php@@ -178,9 +178,6 @@id="application.docker_compose_custom_start_command"helper="If you use this, you need to specify paths relatively and should use the same compose file in the custom command, otherwise the automatically configured labels / etc won't work.<br><br>So in your case, use: <span class='dark:text-warning'>docker compose -f .{{ Str::start($application->base_directory . $application->docker_compose_location, '/') }} up -d</span>"label="Custom Start Command" />- {{-- <x-forms.input placeholder="/docker-compose.yaml" id="application.docker_compose_pr_location"- label="Docker Compose Location For Pull Requests"- helper="It is calculated together with the Base Directory:<br><span class='dark:text-warning'>{{ Str::start($application->base_directory . $application->docker_compose_pr_location, '/') }}</span>" /> --}}</div></div>@else@@ -243,8 +240,6 @@helper="By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$.<br><br>If you want to use env variables inside the labels, turn this off."id="application.settings.is_container_label_escape_enabled" instantSave></x-forms.checkbox></div>- {{-- <x-forms.textarea rows="10" readonly id="application.docker_compose_pr"- label="Docker PR Compose Content" helper="You need to modify the docker compose file." /> --}}@endif@if ($application->dockerfile)