path deployments

This commit is contained in:
Andras Bacsai
2023-05-16 15:27:47 +02:00
parent 28cf89627d
commit 8651d02651
5 changed files with 17 additions and 8 deletions

View File

@@ -383,9 +383,11 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap
$path = $url->getPath();
$labels[] = 'traefik.enable=true';
if ($path === '/') {
$labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
$labels[] = "traefik.http.routers.{$this->application->uuid}.rule=Host(`{$host}`) && Path(`{$path}`)";
} else {
$labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
$labels[] = "traefik.http.routers.{$this->application->uuid}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
$labels[] = "traefik.http.routers.{$this->application->uuid}.middlewares={$this->application->uuid}-stripprefix";
$labels[] = "traefik.http.middlewares.{$this->application->uuid}-stripprefix.stripprefix.prefixes={$path}";
}
}
return $labels;