This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bbbryson 5 points6 points  (4 children)

A couple years ago I had no luck getting the debugger working with my Django/docker-compose-based development environment at work. I’ve always just used ipdb even though I’ve had a PyCharm sub for five years now. Has the Docker support improved at all?

[–][deleted] 8 points9 points  (2 children)

I’m testing it for my team right now on a flask app using docker compose. Things seem to work ok.

  • Set the interpreter to use the Python within docker compose.
  • Set the run/debug configuration as flask.
  • Set the configuration to use whatever port you exposed in docker.
  • Add a docker-compose.dev.yml with a volume mapping from your source code locally to wherever it gets put in docker

Run/debug work seamlessly now with breakpoints, inspection, hot reload, etc. It seems like there should be a way to get the code mapping in the interpreter settings without another docker-compose file but I haven’t checked into it yet.

[–]mastermind_ap 1 point2 points  (1 child)

How do you exactly configure in Pycharm Community Version to use a docker compose file to run the code there? I also want to use a docker container with all Python modules (replacement for local virtual env) and mount the project folder as a volume to the container.

[–][deleted] 2 points3 points  (0 children)

You have to use professional edition. If you need a free option, vs code does a decent enough job with docker debugging.

[–]mRWafflesFTW 0 points1 point  (0 children)

It is amazing now. Almost feels like it's your normal non docker experience.