PHP Tools - Xdebug, Git

Can Xdebug and git be in different containers then app or should they be in the same container? (Containers are defined in Docker-compose?)

I have read that it is best practice to use different containers for different apps, does that corresponds to Git? Or is it better to use git in host machine?

What are best practices using Xdebug with docker?

I am completely new in docker.

Those tools should be on the host system, where you do your development, and don’t really belong in the container at all.

(A not unreasonable mental picture is that each container is a separate computer and your host system is the router that connects them all to the outside, thinking about the spirit of your original question, and it actually doesn’t make sense to run some of these tools on separate computers / in separate containers.)

Thanks for your reply.
My question is driven by information that I read from “What You Need to Know about Docker” book. It says in there that “Execute only one application process per container. Every time you need a new application, it is best practice to use a new container to run this application in.”