diff --git a/php/containers.json b/php/containers.json index c9d57466..5c15c079 100644 --- a/php/containers.json +++ b/php/containers.json @@ -8,9 +8,9 @@ "nextcloud-aio-onlyoffice", "nextcloud-aio-collabora", "nextcloud-aio-talk", - "nextcloud-aio-nextcloud", "nextcloud-aio-notify-push", - "nextcloud-aio-whiteboard" + "nextcloud-aio-whiteboard", + "nextcloud-aio-nextcloud" ], "display_name": "Apache", "image": "ghcr.io/nextcloud-releases/aio-apache", diff --git a/php/src/Controller/DockerController.php b/php/src/Controller/DockerController.php index 13e8bdda..e8f9d591 100644 --- a/php/src/Controller/DockerController.php +++ b/php/src/Controller/DockerController.php @@ -22,6 +22,7 @@ readonly class DockerController { private function PerformRecursiveContainerStart(string $id, bool $pullImage = true) : void { $container = $this->containerDefinitionFetcher->GetContainerById($id); + // Start all dependencies first and then itself foreach($container->GetDependsOn() as $dependency) { $this->PerformRecursiveContainerStart($dependency, $pullImage); } @@ -227,13 +228,19 @@ readonly class DockerController { private function PerformRecursiveContainerStop(string $id) : void { $container = $this->containerDefinitionFetcher->GetContainerById($id); + + // This is a hack but no better solution was found for the meantime + // Stop Collabora first to make sure it force-saves + // See https://github.com/nextcloud/richdocuments/issues/3799 + if ($id === self::TOP_CONTAINER) { + $this->PerformRecursiveContainerStop('nextcloud-aio-collabora'); + } + + // Stop itself first and then all the dependencies + $this->dockerActionManager->StopContainer($container); foreach($container->GetDependsOn() as $dependency) { $this->PerformRecursiveContainerStop($dependency); } - - // Disconnecting is not needed. This also allows to start the containers manually via docker-cli - //$this->dockerActionManager->DisconnectContainerFromNetwork($container); - $this->dockerActionManager->StopContainer($container); } public function StopContainer(Request $request, Response $response, array $args) : Response