to debug a PHP cli script running inside a specific Docker container, you need to find out the the Gateway IP of the docker network your container is attached to.
grab the network name of the running container
$ docker inspect my_container | grep NetworkMode
than grab the gateway IP