Make sure to use docker compose (=v2) and not docker-compose (=v1). V1 got deprecated in June 2023.
V2 should have been installed as a dependency to either docker-ce or as part of Docker Desktop.
In case the command docker compose is not available on your systeme (or uses the old plugin for cloud deployments), make sure to follow the installations instructions: Migrate to Compose V2 | Docker Docs
Thank you very much, that was exactly it, the outdated compose version. I had to download the standalone version from the website manually and now everything works. It actually surprises me a little that this package in my distro is not updated (I use Debian SID).
Are you sure you installed docker-ce from docker’s repos?
Maybe you installed the docker.io package from Debian’s repos, which might result in a different experience than using vanilla docker from docker’s repos.