fix(docker): add fallback for Docker Swarm container labels

This commit is contained in:
Andras Bacsai 2026-01-07 14:57:13 +01:00
parent 40778ad44d
commit cc53e9476e

View file

@ -145,6 +145,12 @@ public function handle(Server $server, ?Collection $containers = null, ?Collecti
$this->applicationContainerStatuses->put($applicationId, collect());
}
$containerName = data_get($labels, 'com.docker.compose.service');
// Fallback for Docker Swarm which uses different labels
if (! $containerName && $this->server->isSwarm()) {
$containerName = data_get($labels, 'coolify.serviceName')
?? data_get($labels, 'coolify.name')
?? data_get($labels, 'com.docker.stack.namespace');
}
if ($containerName) {
$this->applicationContainerStatuses->get($applicationId)->put($containerName, $containerStatus);
}