Docker Compose and Python Debug

Answered

Is debugging support with docker-compose a possibility at this point? I can spin up my debugger (using a standard python debugger, with the docker-compose project interpreter set up correctly), and it spins up my docker containers, but it's attempting to debug on a port that isn't exposed (since PyCharm randomizes it), so it never connects, it just hangs up eventually. Below is the output from the debug init, with the container id that pycharm started, and correctly deciding it should connect to. 

a51be5824a2b:/usr/local/bin/python -u /opt/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client 10.0.2.2 --port 52313 --file /mnt/path/to/file

 

Can I specify the port it will use and then manually expose that port in my docker-compose.yml file? I'm at a bit of an impasse where I may give up on docker+pycharm for local debugging.

1
1 comment
0

Please sign in to leave a comment.