Docker / Xdebug Over LAN Server Mutliple Developers

I’m attempting to setup xdebug on some containers we have at the office. We have a ubuntu server running docker with the firewall wide open over LAN.

Ideally each developer would like to use PHP storm (which we work over a mounted samba drive), to debug code on various websites.

We use apache and have the jwilder nginx proxy to server multiple sites in docker.

I’ve attempted to setup a dbgp proxy with no luck so far. PHP.ini looks like this

xdebug.remote_enable=1
xdebug.remote_host=containername
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_mode=req

Inside the container for the DBPG proxy I have it on the same network as apache and bind the 9001 externally e.g. – “9012:9001”

Using the IDE It does appear to detect the DBGP proxy correctly in phpstorm. I listen for connections and place the IDE key in the get variable to start xdebug session. I’ve tried with the zend debugger extension as well. At this point no break points are hit and the script just continues.

Do I need to do anything in phpstorm to tell PHP storm that the file directory doesn’t match the directory on the server? Am I missing something in the php.ini file.

In this scenario could I simply use remote connect back for multiple developers and get rid of dbpg? Would it pose a security risk if the port was blocked via UFW on the docker host to the external world (I presume at the very least everyone could trigger xdebug as these development sites are exposed to the world per say)?

Source: StackOverflow