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
improve more
Andras Bacsai3c54e01d8787
diff --git a/CONTRIBUTION.md b/CONTRIBUTION.mdindex 8744da671d..c6a5b32735 100644--- a/CONTRIBUTION.md+++ b/CONTRIBUTION.md@@ -22,11 +22,6 @@ You can ask for guidance anytime on our- Run `spin up` - You can notice that errors will be thrown. Don't worry.- If you see weird permission errors, especially on Mac, run `sudo spin up` instead.-If you are running Coolify for the first time:-- Run `./scripts/run dev:init` - This will delete any existing database layouts, migrate database to the new layout, and seed your database.--> If you see the login page with a 404 error, you forgot to run `./scripts/run dev:init`.-### 4) Start developmentYou can login your Coolify instance at `localhost:8000` with `[email protected]` and `password`.diff --git a/app/Console/Commands/Dev.php b/app/Console/Commands/Dev.phpnew file mode 100644index 0000000000..ba60826d19--- /dev/null+++ b/app/Console/Commands/Dev.php@@ -0,0 +1,33 @@+<?php++namespace App\Console\Commands;++use App\Models\InstanceSettings;+use Illuminate\Console\Command;+use Illuminate\Support\Facades\Artisan;+use Illuminate\Support\Facades\Process;++class Dev extends Command+{+ protected $signature = 'dev:init';+ protected $description = 'Init the app in dev mode';++ public function handle()+ {+ // Generate APP_KEY if not exists+ if (empty(env('APP_KEY'))) {+ echo "Generating APP_KEY.\n";+ Artisan::call('key:generate');+ }+ // Seed database if it's empty+ $settings = InstanceSettings::find(0);+ if (!$settings) {+ echo "Initializing instance, seeding database.\n";+ Artisan::call('migrate --seed');+ } else {+ echo "Instance already initialized.\n";+ }+ // Set permissions+ Process::run(['chmod', '-R', 'o+rwx', '.']);+ }+}diff --git a/app/Http/Middleware/NOTUSEDIsBoardingFlow.php b/app/Http/Middleware/NOTUSEDIsBoardingFlow.phpdeleted file mode 100644index 6e820f4839..0000000000--- a/app/Http/Middleware/NOTUSEDIsBoardingFlow.php+++ /dev/null@@ -1,28 +0,0 @@-<?php--namespace App\Http\Middleware;--use Closure;-use Illuminate\Http\Request;-use Symfony\Component\HttpFoundation\Response;-use Illuminate\Support\Str;--class IsBoardingFlow-{- /**- * Handle an incoming request.- *- * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next- */- public function handle(Request $request, Closure $next): Response- {- // ray()->showQueries()->color('orange');- if (showBoarding() && !in_array($request->path(), allowedPathsForBoardingAccounts())) {- if (Str::startsWith($request->path(), 'invitations')) {- return $next($request);- }- return redirect('boarding');- }- return $next($request);- }-}diff --git a/app/Http/Middleware/NOTUSEDIsSubscriptionValid.php b/app/Http/Middleware/NOTUSEDIsSubscriptionValid.phpdeleted file mode 100644index 5774e5190c..0000000000--- a/app/Http/Middleware/NOTUSEDIsSubscriptionValid.php+++ /dev/null@@ -1,45 +0,0 @@-<?php--namespace App\Http\Middleware;--use Closure;-use Illuminate\Http\Request;-use Symfony\Component\HttpFoundation\Response;-use Illuminate\Support\Str;--class IsSubscriptionValid-{- public function handle(Request $request, Closure $next): Response- {- if (isInstanceAdmin()) {- return $next($request);- }- if (!auth()->user() || !isCloud()) {- if ($request->path() === 'subscription') {- return redirect('/');- } else {- return $next($request);- }- }- if (isSubscriptionActive() && $request->path() === 'subscription') {- // ray('active subscription Middleware');- return redirect('/');- }- if (isSubscriptionOnGracePeriod()) {- // ray('is_subscription_in_grace_period Middleware');- return $next($request);- }- if (!isSubscriptionActive() && !isSubscriptionOnGracePeriod()) {- // ray('SubscriptionValid Middleware');- if (!in_array($request->path(), allowedPathsForUnsubscribedAccounts())) {- if (Str::startsWith($request->path(), 'invitations')) {- return $next($request);- }- return redirect('subscription');- } else {- return $next($request);- }- }- return $next($request);- }-}diff --git a/database/factories/StandaloneMongoDBFactory.php b/database/factories/StandaloneMongoDBFactory.phpdeleted file mode 100644index 8ec395e49a..0000000000--- a/database/factories/StandaloneMongoDBFactory.php+++ /dev/null@@ -1,23 +0,0 @@-<?php--namespace Database\Factories;--use Illuminate\Database\Eloquent\Factories\Factory;--/**- * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\StandaloneMongodb>- */-class StandaloneMongodbFactory extends Factory-{- /**- * Define the model's default state.- *- * @return array<string, mixed>- */- public function definition(): array- {- return [- //- ];- }-}diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlindex e789c3ba7b..a9f09efa3f 100644--- a/docker-compose.dev.yml+++ b/docker-compose.dev.yml@@ -70,6 +70,8 @@ services:volumes:- .:/var/www/html:cachedcommand: sh -c "npm install && npm run dev"+ networks:+ - coolifytesting-host:<<: *testing-host-basecontainer_name: coolify-testing-host@@ -77,15 +79,8 @@ services:- /:/host- /var/run/docker.sock:/var/run/docker.sock- /data/coolify/:/data/coolify- # - coolify-data-dev:/data/coolify- # remote-host:- # <<: *testing-host-base- # container_name: coolify-remote-host- # volumes:- # - /:/host- # - /var/run/docker.sock:/var/run/docker.sock- # - /data/coolify/:/data/coolify- # # - coolify-data-dev:/data/coolify+ networks:+ - coolifymailpit:image: "axllent/mailpit:latest"container_name: coolify-mail@@ -116,8 +111,8 @@ volumes:coolify-redis-data-dev:coolify-minio-data-dev:+networks:- coolify:- name: coolify- driver: bridge- external: false+ coolify:+ name: coolify+ external: falsediff --git a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/upindex e5d89d959c..e974e54ccc 100644--- a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up+++ b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up@@ -1,4 +1,5 @@#!/command/execlineb -Pforeground { composer -d /var/www/html/ install }-foreground { php /var/www/html/artisan key:generate }foreground { php /var/www/html/artisan migrate --step }+foreground { php /var/www/html/artisan dev:init }+diff --git a/scripts/run b/scripts/runindex 80ff17a167..dfb011c399 100755--- a/scripts/run+++ b/scripts/run@@ -20,50 +20,50 @@ function help {compgen -A function | cat -n}-function dev:init {- docker exec coolify bash -c "php artisan migrate --seed"- echo "Need to update privileges on a few files. I need your password for that."- sudo chmod -R o+rwx .-}--function sync:v3 {- if [ -z "$1" ]; then- echo -e "Please provide a version.\n\nExample: run sync:v3 3.12.32"- exit 1- fi- skopeo copy --all docker://ghcr.io/coollabsio/coolify:$1 docker://coollabsio/coolify:$1-}+# function dev:init {+# docker exec coolify bash -c "php artisan migrate --seed"+# echo "Need to update privileges on a few files. I need your password for that."+# sudo chmod -R o+rwx .+# }++# function sync:v3 {+# if [ -z "$1" ]; then+# echo -e "Please provide a version.\n\nExample: run sync:v3 3.12.32"+# exit 1+# fi+# skopeo copy --all docker://ghcr.io/coollabsio/coolify:$1 docker://coollabsio/coolify:$1+# }function sync:bunny {php artisan sync:bunny --env=secrets}-function queue {- bash spin exec -u webuser coolify php artisan queue:listen-}+# function queue {+# bash spin exec -u webuser coolify php artisan queue:listen+# }-function horizon {- bash spin exec -u webuser coolify php artisan horizon -vvv-}+# function horizon {+# bash spin exec -u webuser coolify php artisan horizon -vvv+# }-function schedule {- bash spin exec -u webuser coolify php artisan schedule:work-}+# function schedule {+# bash spin exec -u webuser coolify php artisan schedule:work+# }-function schedule:run {- bash spin exec -u webuser coolify php artisan schedule:run-}+# function schedule:run {+# bash spin exec -u webuser coolify php artisan schedule:run+# }-function db {- bash spin exec -u webuser coolify php artisan db-}-function db:seed {- bash spin exec -u webuser coolify php artisan migrate --seed-}+# function db {+# bash spin exec -u webuser coolify php artisan db+# }+# function db:seed {+# bash spin exec -u webuser coolify php artisan migrate --seed+# }-function db:migrate {- bash spin exec -u webuser coolify php artisan migrate --step-}+# function db:migrate {+# bash spin exec -u webuser coolify php artisan migrate --step+# }function db:reset {bash spin exec -u webuser coolify php artisan migrate:fresh --seed@@ -101,9 +101,9 @@ function tinker {}-function build:helper {- act -W .github/workflows/coolify-helper.yml --secret-file .env.secrets-}+# function build:helper {+# act -W .github/workflows/coolify-helper.yml --secret-file .env.secrets+# }function default {help}