Setting Docker Port Bindings When Using Pycharm Run/Debug
This article does a good job showing how to set up a docker python interpreter so I can debug my apps running inside a docker container.
However, it does not show how to specify the port bindings of the container that is started when I run my app using the Run/Debug buttons. I have a flask app running inside the docker container that is listening on port 8000. If I started the container via through the command line, then I would just add "--publish 8000:8000".
Can you please instruct me on how to bind ports using the python Run/Debug configurations.
Thank you!
Please sign in to leave a comment.
Go to Run/Debug Settings > Your Configuration > Docker container settings (click on open folder icon)
At Edit Docker Container Settings you can add Port bindings
https://www.jetbrains.com/help/pycharm/2020.2/docker.html?utm_source=product&utm_medium=link&utm_campaign=PY&utm_content=2020.2#port_bindings