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
fix: public service database
Andras Bacsai7c580f898c38
diff --git a/app/Actions/Database/StartDatabaseProxy.php b/app/Actions/Database/StartDatabaseProxy.phpindex 500798d301..ebbf3f8ccf 100644--- a/app/Actions/Database/StartDatabaseProxy.php+++ b/app/Actions/Database/StartDatabaseProxy.php@@ -25,7 +25,8 @@ class StartDatabaseProxy$proxyContainerName = "{$database->uuid}-proxy";if ($database->getMorphClass() === 'App\Models\ServiceDatabase') {$databaseType = $database->databaseType();- $network = data_get($database, 'service.destination.network');+ // $connectPredefined = data_get($database, 'service.connect_to_docker_network');+ $network = $database->service->uuid;$server = data_get($database, 'service.destination.server');$proxyContainerName = "{$database->service->uuid}-proxy";switch ($databaseType) {diff --git a/app/Livewire/Project/Service/Database.php b/app/Livewire/Project/Service/Database.phpindex a2d8f29a63..ba24d82f7e 100644--- a/app/Livewire/Project/Service/Database.php+++ b/app/Livewire/Project/Service/Database.php@@ -79,7 +79,6 @@ class Database extends Componentpublic function submit(){try {- ray('asdf');$this->validate();$this->database->save();updateCompose($this->database);diff --git a/app/Models/ServiceDatabase.php b/app/Models/ServiceDatabase.phpindex 9e9e9d2025..76c174d08c 100644--- a/app/Models/ServiceDatabase.php+++ b/app/Models/ServiceDatabase.php@@ -57,8 +57,7 @@ class ServiceDatabase extends BaseModelif ($this->service->server->isLocalhost() || isDev()) {$realIp = base_ip();}- $url = "{$realIp}:{$port}";- return $url;+ return "{$realIp}:{$port}";}public function service(){diff --git a/bootstrap/helpers/constants.php b/bootstrap/helpers/constants.phpindex 134cc6aadb..84997d134f 100644--- a/bootstrap/helpers/constants.php+++ b/bootstrap/helpers/constants.php@@ -27,7 +27,8 @@ const DATABASE_DOCKER_IMAGES = ['couchdb','neo4j','influxdb',- 'clickhouse/clickhouse-server'+ 'clickhouse/clickhouse-server',+ 'supabase/postgres'];const SPECIFIC_SERVICES = ['quay.io/minio/minio',diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.phpindex 76e6cb5014..4a2fe7ec8b 100644--- a/resources/views/livewire/project/application/general.blade.php+++ b/resources/views/livewire/project/application/general.blade.php@@ -206,13 +206,13 @@know what areyou doing.</div><x-forms.input- helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='dark:text-white underline' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"+ helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='underline dark:text-white' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"placeholder="--cap-add SYS_ADMIN --device=/dev/fuse --security-opt apparmor:unconfined --ulimit nofile=1024:1024 --tmpfs /run:rw,noexec,nosuid,size=65536k"id="application.custom_docker_run_options" label="Custom Docker Options" />@endif@else<x-forms.input- helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='dark:text-white underline' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"+ helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='underline dark:text-white' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"placeholder="--cap-add SYS_ADMIN --device=/dev/fuse --security-opt apparmor:unconfined --ulimit nofile=1024:1024 --tmpfs /run:rw,noexec,nosuid,size=65536k"id="application.custom_docker_run_options" label="Custom Docker Options" />@endifdiff --git a/resources/views/livewire/project/service/database.blade.php b/resources/views/livewire/project/service/database.blade.phpindex 6d4cfc72be..86ebb9b40b 100644--- a/resources/views/livewire/project/service/database.blade.php+++ b/resources/views/livewire/project/service/database.blade.php@@ -17,15 +17,16 @@label="Image Tag" id="database.image"></x-forms.input></div><div class="flex items-end gap-2">- @if ($db_url_public)- <x-forms.input label="Database URL (public)"- helper="Your credentials are available in your environment variables." type="password" readonly- wire:model="db_url_public" />- @endif+<x-forms.input placeholder="5432" disabled="{{ $database->is_public }}" id="database.public_port"label="Public Port" /><x-forms.checkbox instantSave id="database.is_public" label="Accessible over the internet" /></div>+ @if ($db_url_public)+ <x-forms.input label="Database URL (public)"+ helper="Your credentials are available in your environment variables." type="password" readonly+ wire:model="db_url_public" />+ @endif</div><h3 class="pt-2">Advanced</h3><div class="w-96">