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 local dev + contribution guide
Andras Bacsai00d708610db7
diff --git a/CONTRIBUTION.md b/CONTRIBUTION.mdindex c119305381..8744da671d 100644--- a/CONTRIBUTION.md+++ b/CONTRIBUTION.md@@ -22,7 +22,10 @@ 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.-- Run `./scripts/run setup:dev` - This will generate a secret key for you, delete any existing database layouts, migrate database to the new layout, and seed your database.+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`.@@ -31,7 +34,6 @@ Your horizon (Laravel scheduler): `localhost:8000/horizon` - Only reachable if yMails are caught by Mailpit: `localhost:8025`-## New Service ContributionCheck out the docs [here](https://coolify.io/docs/how-to-add-a-service).diff --git a/docker-compose.dev.yml b/docker-compose.dev.ymlindex 87b4bb6b5c..e789c3ba7b 100644--- a/docker-compose.dev.yml+++ b/docker-compose.dev.yml@@ -56,7 +56,7 @@ services:ports:- "${FORWARD_SOKETI_PORT:-6001}:6001"environment:- SOKETI_DEBUG: "true"+ SOKETI_DEBUG: "false"SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID:-coolify}"SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY:-coolify}"SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}"@@ -115,3 +115,9 @@ volumes:coolify-pg-data-dev:coolify-redis-data-dev:coolify-minio-data-dev:++networks:+ coolify:+ name: coolify+ driver: bridge+ external: falsediff --git a/docker/dev-ssu/Dockerfile b/docker/dev-ssu/Dockerfileindex 58941b73ff..df98985f4b 100644--- a/docker/dev-ssu/Dockerfile+++ b/docker/dev-ssu/Dockerfile@@ -2,7 +2,7 @@ FROM serversideup/php:8.2-fpm-nginxARG TARGETPLATFORM# https://github.com/cloudflare/cloudflared/releases-ARG CLOUDFLARED_VERSION=2023.8.2+ARG CLOUDFLARED_VERSION=2023.10.0ARG POSTGRES_VERSION=15RUN apt-get updatediff --git a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/horizon/dependencies.d/init-setup b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/horizon/dependencies.d/init-setupnew file mode 100644index 0000000000..e69de29bb2diff --git a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/type b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/typenew file mode 100644index 0000000000..3d92b15f2d--- /dev/null+++ b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/type@@ -0,0 +1 @@+oneshot\ No newline at end of filediff --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/upnew file mode 100644index 0000000000..e5d89d959c--- /dev/null+++ b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/init-setup/up@@ -0,0 +1,4 @@+#!/command/execlineb -P+foreground { composer -d /var/www/html/ install }+foreground { php /var/www/html/artisan key:generate }+foreground { php /var/www/html/artisan migrate --step }diff --git a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/scheduler-worker/dependencies.d/init-setup b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/scheduler-worker/dependencies.d/init-setupnew file mode 100644index 0000000000..e69de29bb2diff --git a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/user/contents.d/init-setup b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/user/contents.d/init-setupnew file mode 100644index 0000000000..e69de29bb2diff --git a/docker/dev-ssu/etc/s6-overlay/s6-rc.d/user/contents.d/scheduler-worker b/docker/dev-ssu/etc/s6-overlay/s6-rc.d/user/contents.d/scheduler-workernew file mode 100644index 0000000000..e69de29bb2diff --git a/docker/prod-ssu/Dockerfile b/docker/prod-ssu/Dockerfileindex dac8c56a91..79c0a839c7 100644--- a/docker/prod-ssu/Dockerfile+++ b/docker/prod-ssu/Dockerfile@@ -15,7 +15,7 @@ FROM serversideup/php:8.2-fpm-nginxARG TARGETPLATFORM# https://github.com/cloudflare/cloudflared/releases-ARG CLOUDFLARED_VERSION=2023.8.2+ARG CLOUDFLARED_VERSION=2023.10.0ARG POSTGRES_VERSION=15WORKDIR /var/www/htmldiff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.phpindex b2111d5611..ed288f9ee6 100644--- a/resources/views/auth/login.blade.php+++ b/resources/views/auth/login.blade.php@@ -24,20 +24,20 @@<form action="/login" method="POST" class="flex flex-col gap-2">@csrf@env('local')- <x-forms.input value="[email protected]" type="email" name="email" required- label="{{ __('input.email') }}" autofocus />+ <x-forms.input value="[email protected]" type="email" name="email" required+ label="{{ __('input.email') }}" autofocus />- <x-forms.input value="password" type="password" name="password" required- label="{{ __('input.password') }}" />- <a href="/forgot-password" class="text-xs">- {{ __('auth.forgot_password') }}?- </a>- @else- <x-forms.input type="email" name="email" required label="{{ __('input.email') }}" autofocus />- <x-forms.input type="password" name="password" required label="{{ __('input.password') }}" />- <a href="/forgot-password" class="text-xs">- {{ __('auth.forgot_password') }}?- </a>+ <x-forms.input value="password" type="password" name="password" required+ label="{{ __('input.password') }}" />+ <a href="/forgot-password" class="text-xs">+ {{ __('auth.forgot_password') }}?+ </a>+ @else+ <x-forms.input type="email" name="email" required label="{{ __('input.email') }}" autofocus />+ <x-forms.input type="password" name="password" required label="{{ __('input.password') }}" />+ <a href="/forgot-password" class="text-xs">+ {{ __('auth.forgot_password') }}?+ </a>@endenv<x-forms.button type="submit">{{ __('auth.login') }}</x-forms.button>@if (!$is_registration_enabled)diff --git a/resources/views/components/forms/input.blade.php b/resources/views/components/forms/input.blade.phpindex 4e9fffef5b..3e9c3a35da 100644--- a/resources/views/components/forms/input.blade.php+++ b/resources/views/components/forms/input.blade.php@@ -22,7 +22,7 @@</svg></div>@endif- <input {{ $attributes->merge(['class' => $defaultClass . ' pl-10']) }} @required($required)+ <input value="{{ $value }}" {{ $attributes->merge(['class' => $defaultClass . ' pl-10']) }} @required($required)wire:model={{ $id }} wire:dirty.class.remove='text-white' wire:dirty.class="input-warning"wire:loading.attr="disabled" type="{{ $type }}" @readonly($readonly) @disabled($disabled)id="{{ $id }}" name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"@@ -30,10 +30,11 @@</div>@else- <input {{ $attributes->merge(['class' => $defaultClass]) }} @required($required) @readonly($readonly)- wire:model={{ $id }} wire:dirty.class.remove='text-white' wire:dirty.class="input-warning"- wire:loading.attr="disabled" type="{{ $type }}" @disabled($disabled)- id="{{ $id }}" name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}">+ <input @if($value) value="{{ $value }}" @endif {{ $attributes->merge(['class' => $defaultClass]) }} @required($required)+ @readonly($readonly) wire:model={{ $id }} wire:dirty.class.remove='text-white'+ wire:dirty.class="input-warning" wire:loading.attr="disabled" type="{{ $type }}"+ @disabled($disabled) id="{{ $id }}" name="{{ $name }}"+ placeholder="{{ $attributes->get('placeholder') }}">@endif@if (!$label && $helper)<x-helper :helper="$helper" />diff --git a/scripts/run b/scripts/runindex 7362b1e5ac..80ff17a167 100755--- a/scripts/run+++ b/scripts/run@@ -20,12 +20,12 @@ function help {compgen -A function | cat -n}-function setup:dev {- docker exec coolify bash -c "composer install"- docker exec coolify bash -c "php artisan key:generate"- docker exec coolify bash -c "php artisan migrate:fresh --seed"+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" ]; thenecho -e "Please provide a version.\n\nExample: run sync:v3 3.12.32"@@ -57,9 +57,12 @@ function 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:migrate {- bash spin exec -u webuser coolify php artisan migrate+ bash spin exec -u webuser coolify php artisan migrate --step}function db:reset {