diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 21c7e4820..530136378 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -19,6 +19,7 @@ use App\Notifications\Application\DeploymentFailed; use App\Notifications\Application\DeploymentSuccess; use App\Traits\ExecuteRemoteCommand; use Carbon\Carbon; +use Exception; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldBeEncrypted; use Illuminate\Contracts\Queue\ShouldQueue; diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index ebbdcd5da..b8dfd023a 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -604,6 +604,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_stripprefix_enabled: $application->isStripprefixEnabled(), redirect_direction: $application->redirect ); + $labels = $labels->merge(convertToKeyValueCollection($proxyLabels)); $proxyLabels = fqdnLabelsForCaddy( network: $application->destination->network, uuid: $appUuid, @@ -659,6 +660,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled() ); + $labels = $labels->merge(convertToKeyValueCollection($proxyLabels)); $proxyLabels = fqdnLabelsForCaddy( network: $application->destination->network, uuid: $appUuid, @@ -671,6 +673,9 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview $labels = $labels->merge(convertToKeyValueCollection($proxyLabels)); } } + $labels = $labels->map(function ($value, $key) { + return "$key=$value"; + })->values(); return $labels->all(); } diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index c3d7d0bfc..d4fce18bd 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -2045,6 +2045,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal service_name: $serviceName, image: data_get($service, 'image') ); + $serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels)); $proxyLabels = fqdnLabelsForCaddy( network: $resource->destination->network, uuid: $resource->uuid, @@ -2818,6 +2819,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal is_gzip_enabled: $resource->isGzipEnabled(), is_stripprefix_enabled: $resource->isStripprefixEnabled(), ); + $serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels)); $proxyLabels = fqdnLabelsForCaddy( network: $resource->destination->network,