I still don't understand how people use git worktrees with Docker. You need a full database and etc. For me it's simpler to have multiple checkouts.
Regardless of whether the former solves it, I was going to suggest you could use compose or whatever in your 'human' tree, and then tell the AI to use equivalent docker commands without using compose, so it gets anonymous/its own named containers, but you keep the convenience.