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
wip: nixpacksarchive
Andras Bacsaib7786504b847
diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.phpindex 80054d5db7..13d73c36e2 100644--- a/app/Http/Livewire/Project/Application/General.php+++ b/app/Http/Livewire/Project/Application/General.php@@ -48,6 +48,7 @@ class General extends Component'application.ports_exposes' => 'required','application.ports_mappings' => 'nullable','application.dockerfile' => 'nullable',+ 'application.nixpkgsarchive' => 'nullable',];protected $validationAttributes = ['application.name' => 'name',@@ -66,6 +67,7 @@ class General extends Component'application.ports_exposes' => 'Ports exposes','application.ports_mappings' => 'Ports mappings','application.dockerfile' => 'Dockerfile',+ 'application.nixpkgsarchive' => 'Nixpkgs archive',];public function instantSave()diff --git a/app/Http/Middleware/IsBoardingFlow.php b/app/Http/Middleware/IsBoardingFlow.phpindex e0542a57a9..5858fe1918 100644--- a/app/Http/Middleware/IsBoardingFlow.php+++ b/app/Http/Middleware/IsBoardingFlow.php@@ -15,7 +15,7 @@ class IsBoardingFlow*/public function handle(Request $request, Closure $next): Response{- ray()->showQueries()->color('orange');+ // ray()->showQueries()->color('orange');if (showBoarding() && !in_array($request->path(), allowedPathsForBoardingAccounts())) {return redirect('boarding');}diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex d5431b0e85..53a6c14063 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -28,6 +28,8 @@ use Spatie\Url\Url;use Symfony\Component\Yaml\Yaml;use Throwable;use Visus\Cuid2\Cuid2;+use Yosymfony\Toml\Toml;+use Yosymfony\Toml\TomlArray;class ApplicationDeploymentJob implements ShouldQueue{@@ -411,6 +413,7 @@ class ApplicationDeploymentJob implements ShouldQueueprivate function generate_nixpacks_confs(){+ ray('nixpkgsarchive', $this->application->nixpkgsarchive);$this->execute_remote_command(["echo -n 'Generating nixpacks configuration.'",@@ -419,6 +422,13 @@ class ApplicationDeploymentJob implements ShouldQueue[$this->execute_in_builder("cp {$this->workdir}/.nixpacks/Dockerfile {$this->workdir}/Dockerfile")],[$this->execute_in_builder("rm -f {$this->workdir}/.nixpacks/Dockerfile")]);++ // if ($this->application->nixpkgsarchive) {+ // $this->execute_remote_command([+ // $this->execute_in_builder("cat {$this->workdir}/nixpacks.toml"), "hidden" => true, "save" => 'nixpacks_toml'+ // ]);++ // }}private function nixpacks_build_cmd()diff --git a/composer.json b/composer.jsonindex c8acddbe52..79f3793dd5 100644--- a/composer.json+++ b/composer.json@@ -35,7 +35,8 @@"spatie/url": "^2.2","stripe/stripe-php": "^12.0","symfony/yaml": "^6.2",- "visus/cuid2": "^2.0.0"+ "visus/cuid2": "^2.0.0",+ "yosymfony/toml": "^1.0"},"require-dev": {"fakerphp/faker": "^v1.21.0",diff --git a/composer.lock b/composer.lockindex cef0f8b2b0..63d0c626d9 100644--- a/composer.lock+++ b/composer.lock@@ -4,7 +4,7 @@"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies","This file is @generated automatically"],- "content-hash": "0603276b60e77cd859fabacdaaf31550",+ "content-hash": "cf138424c896f30b035bc8cdff63e8d1","packages": [{"name": "aws/aws-crt-php",@@ -9771,6 +9771,116 @@},"time": "2022-06-03T18:03:27+00:00"},+ {+ "name": "yosymfony/parser-utils",+ "version": "v2.0.0",+ "source": {+ "type": "git",+ "url": "https://github.com/yosymfony/parser-utils.git",+ "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/00bec9a12722b21f2baf7f9db35f127e90c162c9",+ "reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9",+ "shasum": ""+ },+ "require": {+ "php": ">=7.1"+ },+ "require-dev": {+ "phpunit/phpunit": "^6"+ },+ "type": "library",+ "extra": {+ "branch-alias": {+ "dev-master": "2.0-dev"+ }+ },+ "autoload": {+ "psr-4": {+ "Yosymfony\\ParserUtils\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Victor Puertas",+ "email": "[email protected]",+ "homepage": "http://yosymfony.com"+ }+ ],+ "description": "Parser utilities",+ "homepage": "http://github.com/yosymfony/toml",+ "keywords": [+ "lexer",+ "parser"+ ],+ "support": {+ "issues": "https://github.com/yosymfony/parser-utils/issues",+ "source": "https://github.com/yosymfony/parser-utils/tree/master"+ },+ "time": "2018-06-29T15:31:11+00:00"+ },+ {+ "name": "yosymfony/toml",+ "version": "v1.0.4",+ "source": {+ "type": "git",+ "url": "https://github.com/yosymfony/toml.git",+ "reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e"+ },+ "dist": {+ "type": "zip",+ "url": "https://api.github.com/repos/yosymfony/toml/zipball/bdab92ad920d0e36810a3a3e4a998d23f3498f8e",+ "reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e",+ "shasum": ""+ },+ "require": {+ "php": ">=7.1",+ "yosymfony/parser-utils": "^2.0"+ },+ "require-dev": {+ "phpunit/phpunit": "^7.1"+ },+ "type": "library",+ "extra": {+ "branch-alias": {+ "dev-master": "1.0-dev"+ }+ },+ "autoload": {+ "psr-4": {+ "Yosymfony\\Toml\\": "src/"+ }+ },+ "notification-url": "https://packagist.org/downloads/",+ "license": [+ "MIT"+ ],+ "authors": [+ {+ "name": "Victor Puertas",+ "email": "[email protected]",+ "homepage": "http://yosymfony.com"+ }+ ],+ "description": "A PHP parser for TOML compatible with specification 0.4.0",+ "homepage": "http://github.com/yosymfony/toml",+ "keywords": [+ "mojombo",+ "parser",+ "toml"+ ],+ "support": {+ "issues": "https://github.com/yosymfony/toml/issues",+ "source": "https://github.com/yosymfony/toml/tree/master"+ },+ "time": "2018-08-08T15:08:14+00:00"+ },{"name": "zbateson/mail-mime-parser","version": "2.4.0",diff --git a/database/migrations/2023_08_22_071057_add_nixpkgsarchive_to_applications.php b/database/migrations/2023_08_22_071057_add_nixpkgsarchive_to_applications.phpnew file mode 100644index 0000000000..4c3b283db2--- /dev/null+++ b/database/migrations/2023_08_22_071057_add_nixpkgsarchive_to_applications.php@@ -0,0 +1,22 @@+<?php++use Illuminate\Database\Migrations\Migration;+use Illuminate\Database\Schema\Blueprint;+use Illuminate\Support\Facades\Schema;++return new class extends Migration+{+ public function up(): void+ {+ Schema::table('applications', function (Blueprint $table) {+ $table->string('nixpkgsarchive')->nullable();+ });+ }++ public function down(): void+ {+ Schema::table('teams', function (Blueprint $table) {+ $table->dropColumn('nixpkgsarchive');+ });+ }+};diff --git a/docker/coolify-helper/Dockerfile b/docker/coolify-helper/Dockerfileindex 301322c63e..45834de787 100644--- a/docker/coolify-helper/Dockerfile+++ b/docker/coolify-helper/Dockerfile@@ -10,7 +10,7 @@ ARG DOCKER_BUILDX_VERSION=0.11.2# https://github.com/buildpacks/pack/releasesARG PACK_VERSION=0.30.0# https://github.com/railwayapp/nixpacks/releases-ARG NIXPACKS_VERSION=1.13.0+ARG NIXPACKS_VERSION=1.14.0USER rootWORKDIR /artifactsdiff --git a/docker/testing-host/Dockerfile b/docker/testing-host/Dockerfileindex 6783e4f69d..3a1e053a5e 100644--- a/docker/testing-host/Dockerfile+++ b/docker/testing-host/Dockerfile@@ -10,7 +10,7 @@ ARG DOCKER_BUILDX_VERSION=0.11.2# https://github.com/buildpacks/pack/releasesARG PACK_VERSION=0.30.0# https://github.com/railwayapp/nixpacks/releases-ARG NIXPACKS_VERSION=1.13.0+ARG NIXPACKS_VERSION=1.14.0USER rootWORKDIR /rootdiff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.phpindex f8d5aff374..768f19d7ed 100644--- a/resources/views/livewire/project/application/general.blade.php+++ b/resources/views/livewire/project/application/general.blade.php@@ -26,11 +26,17 @@@endif@endif</div>- <x-forms.select id="application.build_pack" label="Build Pack" required>- <option value="nixpacks">Nixpacks</option>- <option value="dockerfile">Dockerfile</option>- <option disabled value="compose">Compose</option>- </x-forms.select>+ <div class="flex items-end gap-2">+ <x-forms.select id="application.build_pack" label="Build Pack" required>+ <option value="nixpacks">Nixpacks</option>+ <option value="dockerfile">Dockerfile</option>+ <option disabled value="compose">Compose</option>+ </x-forms.select>+ {{-- @if ($application->build_pack === 'nixpacks')+ <x-forms.input id="application.nixpkgsarchive" label="NixPackages Archive (nixpkgsArchive)"+ helper="You can customize the NixPackages archive to use."> </x-forms.input>+ @endif --}}+ </div>@if ($application->settings->is_static)<x-forms.select id="application.static_image" label="Static Image" required><option value="nginx:alpine">nginx:alpine</option>