I am running two Docker instances and each of them has his own Xdebug and his own PHP of course they behave as an independent server each one. This is how I expose the port "9001" in my Dockerfile:
EXPOSE 80 9001
Having said that I am using "docker-compose" to build my stack and this is how my docker-compose.yml file looks like:
From there I would expect that the port 9001 from erx would be mapped to port 9002 on the host and 9001 on api would be mapped to 9003 on the host, at least this is how Docker port mapping works (unless I am completely wrong). And this is how I have setup Xdebug on my IDE:
As soon as I run my stack and try to listen on port 9003, the IDE says there is already a connection listening on that port. I don't know what I am missing here. How do I setup Xdebug properly for both containers and both projects IDE's?