Both traffic analytics and activitypub (and their dependencies – which are rather “jobs” and not runtime containers) are designed to serve multiple Ghost sites. So, you could theoretically have a docker compose for all “shared services” and one for each Ghost site – or any other combination.
It will certainly require some tinkering. Setting up traffic analytics and activitypub isn’t quite straightforward, but doable. In my eyes, once you’ve set it up though, it requires less maintenance (since all dependencies are in the containers) than the CLI.