Skip to content

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.

feat(build-packs): mark Nixpacks as deprecated and recommend Railpack

Andras Bacsai90c2e58e52d4
diff --git a/config/deprecations.php b/config/deprecations.php
index 551b562fa7..5bd7f0589c 100644
--- a/config/deprecations.php
+++ b/config/deprecations.php
@@ -2,4 +2,5 @@
return [
'swarm' => 'Docker Swarm is deprecated and will be removed in Coolify v5. Coolify v5 will be replacing Swarm with native Docker Compose replicas and our own scaling solution. Existing Swarm deployments will continue to work on v4 as-is. We do not recommend setting up new Swarm deployments for the time being.',
+ 'nixpacks' => 'Nixpacks is deprecated and is in maintenance mode upstream. We recommend Railpack, the successor of Nixpacks, for new and existing applications.',
];
diff --git a/resources/views/components/nixpacks-deprecated-callout.blade.php b/resources/views/components/nixpacks-deprecated-callout.blade.php
new file mode 100644
index 0000000000..5200e4da5c
--- /dev/null
+++ b/resources/views/components/nixpacks-deprecated-callout.blade.php
@@ -0,0 +1,3 @@
+<x-callout type="warning" title="Nixpacks is deprecated" {{ $attributes }}>
+ {{ config('deprecations.nixpacks') }}
+</x-callout>
diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php
index 3f8ef0fce9..611b3ea368 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -109,7 +109,7 @@
<div class="grid gap-4 sm:grid-cols-2">
<x-forms.listbox id="buildPack" label="Build strategy" live :options="[
['value' => 'railpack', 'label' => 'Railpack'],
- ['value' => 'nixpacks', 'label' => 'Nixpacks'],
+ ['value' => 'nixpacks', 'label' => 'Nixpacks (deprecated)'],
['value' => 'static', 'label' => 'Static'],
['value' => 'dockerfile', 'label' => 'Dockerfile'],
['value' => 'dockercompose', 'label' => 'Compose'],
@@ -121,6 +121,9 @@
]" x-bind:disabled="!canUpdate" />
@endif
</div>
+ @if ($buildPack === 'nixpacks')
+ <x-nixpacks-deprecated-callout class="mt-4" />
+ @endif
</div>
@endif
@if ($application->could_set_build_commands() || ($isStatic && $buildPack !== 'static'))
diff --git a/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php b/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php
index b0dc41bb4d..86eb652392 100644
--- a/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php
+++ b/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php
@@ -57,7 +57,7 @@
<x-forms.input id="branch" required label="Branch" />
<x-forms.listbox id="build_pack" label="Build pack" required live :options="[
['value' => 'railpack', 'label' => 'Railpack'],
- ['value' => 'nixpacks', 'label' => 'Nixpacks'],
+ ['value' => 'nixpacks', 'label' => 'Nixpacks (deprecated)'],
['value' => 'static', 'label' => 'Static'],
['value' => 'dockerfile', 'label' => 'Dockerfile'],
['value' => 'dockercompose', 'label' => 'Docker Compose'],
@@ -76,6 +76,10 @@
@endif
</div>
+ @if ($build_pack === 'nixpacks')
+ <x-nixpacks-deprecated-callout />
+ @endif
+
@if ($build_pack === 'dockercompose')
<div x-data="{
baseDir: @js($base_directory),
diff --git a/resources/views/livewire/project/new/github-private-repository.blade.php b/resources/views/livewire/project/new/github-private-repository.blade.php
index 9ca9c2fec3..e2b691f929 100644
--- a/resources/views/livewire/project/new/github-private-repository.blade.php
+++ b/resources/views/livewire/project/new/github-private-repository.blade.php
@@ -113,7 +113,7 @@
])->values()->all()" />
<x-forms.listbox id="build_pack" label="Build pack" required live :options="[
['value' => 'railpack', 'label' => 'Railpack'],
- ['value' => 'nixpacks', 'label' => 'Nixpacks'],
+ ['value' => 'nixpacks', 'label' => 'Nixpacks (deprecated)'],
['value' => 'static', 'label' => 'Static'],
['value' => 'dockerfile', 'label' => 'Dockerfile'],
['value' => 'dockercompose', 'label' => 'Docker Compose'],
@@ -134,6 +134,10 @@
@endif
</div>
+ @if ($build_pack === 'nixpacks')
+ <x-nixpacks-deprecated-callout />
+ @endif
+
@if ($build_pack === 'dockercompose')
<div x-data="{
baseDir: @js($base_directory),
diff --git a/resources/views/livewire/project/new/gitlab-private-repository.blade.php b/resources/views/livewire/project/new/gitlab-private-repository.blade.php
index b047669071..a088844ec0 100644
--- a/resources/views/livewire/project/new/gitlab-private-repository.blade.php
+++ b/resources/views/livewire/project/new/gitlab-private-repository.blade.php
@@ -109,7 +109,7 @@
])->values()->all()" />
<x-forms.listbox id="build_pack" label="Build pack" required live :options="[
['value' => 'railpack', 'label' => 'Railpack'],
- ['value' => 'nixpacks', 'label' => 'Nixpacks'],
+ ['value' => 'nixpacks', 'label' => 'Nixpacks (deprecated)'],
['value' => 'static', 'label' => 'Static'],
['value' => 'dockerfile', 'label' => 'Dockerfile'],
['value' => 'dockercompose', 'label' => 'Docker Compose'],
@@ -130,6 +130,10 @@
@endif
</div>
+ @if ($build_pack === 'nixpacks')
+ <x-nixpacks-deprecated-callout />
+ @endif
+
@if ($build_pack === 'dockercompose')
<div x-data="{
baseDir: @js($base_directory),
diff --git a/resources/views/livewire/project/new/public-git-repository.blade.php b/resources/views/livewire/project/new/public-git-repository.blade.php
index 137d880eed..8e0b7a1bfe 100644
--- a/resources/views/livewire/project/new/public-git-repository.blade.php
+++ b/resources/views/livewire/project/new/public-git-repository.blade.php
@@ -62,7 +62,7 @@
helper="You can choose another branch after the application is created." />
<x-forms.listbox id="build_pack" label="Build pack" required live :options="[
['value' => 'railpack', 'label' => 'Railpack'],
- ['value' => 'nixpacks', 'label' => 'Nixpacks'],
+ ['value' => 'nixpacks', 'label' => 'Nixpacks (deprecated)'],
['value' => 'static', 'label' => 'Static'],
['value' => 'dockerfile', 'label' => 'Dockerfile'],
['value' => 'dockercompose', 'label' => 'Docker Compose'],
@@ -83,6 +83,10 @@
@endif
</div>
+ @if ($build_pack === 'nixpacks')
+ <x-nixpacks-deprecated-callout />
+ @endif
+
@if ($build_pack === 'dockercompose')
<div x-data="{
baseDir: @js($base_directory),
diff --git a/tests/Feature/NixpacksDeprecationTest.php b/tests/Feature/NixpacksDeprecationTest.php
new file mode 100644
index 0000000000..55a7e823c3
--- /dev/null
+++ b/tests/Feature/NixpacksDeprecationTest.php
@@ -0,0 +1,90 @@
+<?php
+
+use App\Livewire\Project\Application\General;
+use App\Models\Application;
+use App\Models\Environment;
+use App\Models\InstanceSettings;
+use App\Models\PrivateKey;
+use App\Models\Project;
+use App\Models\Server;
+use App\Models\StandaloneDocker;
+use App\Models\Team;
+use App\Models\User;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+use Livewire\Livewire;
+
+uses(RefreshDatabase::class);
+
+beforeEach(function () {
+ $this->team = Team::factory()->create();
+ $this->user = User::factory()->create();
+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);
+
+ $this->actingAs($this->user);
+ session(['currentTeam' => $this->team]);
+ InstanceSettings::unguarded(function () {
+ InstanceSettings::updateOrCreate(['id' => 0], []);
+ });
+
+ $this->project = Project::factory()->create(['team_id' => $this->team->id]);
+ $this->environment = Environment::factory()->create(['project_id' => $this->project->id]);
+ $this->privateKey = PrivateKey::create([
+ 'name' => 'Test Key',
+ 'private_key' => '-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
+QyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevAAAAJi/QySHv0Mk
+hwAAAAtzc2gtZWQyNTUxOQAAACBbhpqHhqv6aI67Mj9abM3DVbmcfYhZAhC7ca4d9UCevA
+AAAECBQw4jg1WRT2IGHMncCiZhURCts2s24HoDS0thHnnRKVuGmoeGq/pojrsyP1pszcNV
+uZx9iFkCELtxrh31QJ68AAAAEXNhaWxANzZmZjY2ZDJlMmRkAQIDBA==
+-----END OPENSSH PRIVATE KEY-----',
+ 'team_id' => $this->team->id,
+ ]);
+ $this->server = Server::factory()->create([
+ 'team_id' => $this->team->id,
+ 'private_key_id' => $this->privateKey->id,
+ ]);
+ $this->destination = StandaloneDocker::where('server_id', $this->server->id)->first()
+ ?? StandaloneDocker::factory()->create(['server_id' => $this->server->id, 'network' => 'coolify-test']);
+});
+
+test('the application page shows the nixpacks deprecation notice only for nixpacks', function (string $buildPack, bool $showsNotice) {
+ $application = Application::factory()->create([
+ 'environment_id' => $this->environment->id,
+ 'destination_id' => $this->destination->id,
+ 'destination_type' => StandaloneDocker::class,
+ 'build_pack' => $buildPack,
+ 'static_image' => 'nginx:alpine',
+ 'base_directory' => '/',
+ 'ports_exposes' => '3000',
+ 'is_http_basic_auth_enabled' => false,
+ 'redirect' => 'no',
+ ]);
+
+ $component = Livewire::test(General::class, ['application' => $application])->assertSuccessful();
+
+ $showsNotice
+ ? $component->assertSee(config('deprecations.nixpacks'))
+ : $component->assertDontSee(config('deprecations.nixpacks'));
+})->with([
+ 'nixpacks' => ['nixpacks', true],
+ 'railpack' => ['railpack', false],
+]);
+
+test('switching the build pack to railpack hides the nixpacks deprecation notice', function () {
+ $application = Application::factory()->create([
+ 'environment_id' => $this->environment->id,
+ 'destination_id' => $this->destination->id,
+ 'destination_type' => StandaloneDocker::class,
+ 'build_pack' => 'nixpacks',
+ 'static_image' => 'nginx:alpine',
+ 'base_directory' => '/',
+ 'ports_exposes' => '3000',
+ 'is_http_basic_auth_enabled' => false,
+ 'redirect' => 'no',
+ ]);
+
+ Livewire::test(General::class, ['application' => $application])
+ ->assertSee(config('deprecations.nixpacks'))
+ ->set('buildPack', 'railpack')
+ ->assertDontSee(config('deprecations.nixpacks'));
+});