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
feat(docker): limit container name prefixes to 30 characters
peaklabs-dev6ad739a53cac
diff --git a/app/Livewire/Project/Application/Advanced.php b/app/Livewire/Project/Application/Advanced.phpindex b3564df0bb..a57d529bcb 100644--- a/app/Livewire/Project/Application/Advanced.php+++ b/app/Livewire/Project/Application/Advanced.php@@ -70,7 +70,7 @@ class Advanced extends Component#[Validate(['string', 'nullable'])]public ?string $customInternalName = null;- #[Validate(['string', 'nullable', 'max:47'])]+ #[Validate(['string', 'nullable', 'max:'.ApplicationSetting::MAX_CONTAINER_NAME_PREFIX_LENGTH])]public ?string $customContainerNamePrefix = null;#[Validate(['boolean'])]diff --git a/app/Models/ApplicationSetting.php b/app/Models/ApplicationSetting.phpindex 60fb9b2336..18b26f454f 100644--- a/app/Models/ApplicationSetting.php+++ b/app/Models/ApplicationSetting.php@@ -50,6 +50,12 @@ use OpenApi\Attributes as OA;)]class ApplicationSetting extends Model{+ /**+ * Keeps generated names (prefix, timestamp and for compose apps the service name) well below the+ * 63 character DNS label limit, with room for a longer suffix in the future.+ */+ public const MAX_CONTAINER_NAME_PREFIX_LENGTH = 30;+protected $casts = ['is_static' => 'boolean','is_spa' => 'boolean',diff --git a/bootstrap/helpers/api.php b/bootstrap/helpers/api.phpindex 81676ab070..b32870a5f7 100644--- a/bootstrap/helpers/api.php+++ b/bootstrap/helpers/api.php@@ -4,6 +4,7 @@ use App\Actions\Shared\MigrateResourceToDestination;use App\Enums\BuildPackTypes;use App\Enums\RedirectTypes;use App\Enums\StaticImageTypes;+use App\Models\ApplicationSetting;use App\Models\Environment;use App\Models\StandaloneDocker;use App\Models\SwarmDocker;@@ -141,7 +142,7 @@ function sharedDataApplications()'gpu_options' => 'string|nullable','is_consistent_container_name_enabled' => 'boolean','custom_internal_name' => 'string|nullable',- 'custom_container_name_prefix' => 'string|nullable|max:47',+ 'custom_container_name_prefix' => 'string|nullable|max:'.ApplicationSetting::MAX_CONTAINER_NAME_PREFIX_LENGTH,'preview_url_template' => 'string','max_restart_count' => 'integer|min:0','stop_grace_period' => 'nullable|integer|min:'.MIN_STOP_GRACE_PERIOD_SECONDS.'|max:'.MAX_STOP_GRACE_PERIOD_SECONDS,diff --git a/resources/views/livewire/project/application/advanced.blade.php b/resources/views/livewire/project/application/advanced.blade.phpindex 3a5549e0ea..27b40546bb 100644--- a/resources/views/livewire/project/application/advanced.blade.php+++ b/resources/views/livewire/project/application/advanced.blade.php@@ -56,7 +56,7 @@<form wire:submit="saveCustomNamePrefix" class="w-full"><x-unsaved-bar action="saveCustomNamePrefix" targets="customContainerNamePrefix" /><x-forms.input- helper="Optional prefix for generated container names. Containers are named <span class='font-bold'>prefix-timestamp</span>, for example <span class='font-bold'>shop-api-20260908T141530</span>, instead of starting with <span class='font-bold'>{{ $application->uuid }}</span>.<br><br>The prefix is converted to slug format when saved, can be up to 47 characters and must be unique on this server. Rolling updates keep working."+ helper="Optional prefix for generated container names. Containers are named <span class='font-bold'>prefix-timestamp</span>, for example <span class='font-bold'>shop-api-20260908T141530</span>, instead of starting with <span class='font-bold'>{{ $application->uuid }}</span>.<br><br>The prefix is converted to slug format when saved, can be up to {{ \App\Models\ApplicationSetting::MAX_CONTAINER_NAME_PREFIX_LENGTH }} characters and must be unique on this server. Rolling updates keep working."id="customContainerNamePrefix" label="Container name prefix" placeholder="e.g. my-api"canGate="update" :canResource="$application" /></form>