I’m not sure, what could be the root cause of this. Perhaps something related to docker. Do you have any errors in your logfiles concerning file system access / permissions, etc.?
Maybe connected to Throwing warnings with PHP 8.2 and Matomo 4.13.1 - where the is_dir function seems to be the cause. This operation can take some time on slow storage. Do you by chance use a network drive for the Matomo files / docker container?