diff --git a/app/Actions/Proxy/InstallProxy.php b/app/Actions/Proxy/InstallProxy.php index 090a84990..460727514 100644 --- a/app/Actions/Proxy/InstallProxy.php +++ b/app/Actions/Proxy/InstallProxy.php @@ -3,9 +3,11 @@ namespace App\Actions\Proxy; use App\Enums\ActivityTypes; +use App\Models\InstanceSettings; use App\Models\Server; use Spatie\Activitylog\Models\Activity; use Illuminate\Support\Str; +use Spatie\Url\Url; class InstallProxy { @@ -61,8 +63,10 @@ class InstallProxy protected function getEnvContents() { + $instance_fqdn = InstanceSettings::find(1)->fqdn ?? config('app.url'); + $url = Url::fromString($instance_fqdn); $data = [ - 'TRAEFIK_DASHBOARD_HOST' => '', + 'TRAEFIK_DASHBOARD_HOST' => $url->getHost(), 'LETS_ENCRYPT_EMAIL' => '', ]; diff --git a/app/Jobs/DeployApplicationJob.php b/app/Jobs/DeployApplicationJob.php index 71c965fac..1b8dce612 100644 --- a/app/Jobs/DeployApplicationJob.php +++ b/app/Jobs/DeployApplicationJob.php @@ -13,6 +13,7 @@ use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Storage; use Spatie\Activitylog\Models\Activity; use Symfony\Component\Yaml\Yaml; @@ -379,8 +380,13 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap if ($this->application->fqdn) { $url = Url::fromString($this->application->fqdn); $host = $url->getHost(); + $path = $url->getPath(); $labels[] = 'traefik.enable=true'; - $labels[] = "traefik.http.routers.container.rule=Host(`{$host}`)"; + if ($path === '/') { + $labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"; + } else { + $labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"; + } } return $labels; } diff --git a/resources/views/livewire/project/application/deploy.blade.php b/resources/views/livewire/project/application/deploy.blade.php index fcb0ca71b..d2e2cec6d 100644 --- a/resources/views/livewire/project/application/deploy.blade.php +++ b/resources/views/livewire/project/application/deploy.blade.php @@ -1,7 +1,7 @@
@if ($application->status === 'running') - Restart + Rebuild Force Rebuild Stop @else diff --git a/scripts/run b/scripts/run index f08d133bc..44fe4ca7d 100755 --- a/scripts/run +++ b/scripts/run @@ -23,7 +23,7 @@ function sync-bunny { php artisan sync:bunny --env=secrets } function queue { - bash vendor/bin/spin exec -u webuser coolify php artisan horizon + bash vendor/bin/spin exec -u webuser coolify php artisan queue:listen } function schedule { bash vendor/bin/spin exec -u webuser coolify php artisan schedule:work @@ -39,7 +39,7 @@ function mfs { } function reset-db-production { bash vendor/bin/spin exec -u webuser coolify php artisan migrate:fresh --force --seed --seeder=ProductionSeeder || - php artisan migrate:fresh --force --seed --seeder=ProductionSeeder + php artisan migrate:fresh --force --seed --seeder=ProductionSeeder } function coolify { bash vendor/bin/spin exec -u webuser coolify bash