Skip to content

Instantly share code, notes, and snippets.

@annawinkler
Last active April 23, 2019 15:47
Show Gist options
  • Save annawinkler/8f5349fec997933498a838787b0e0431 to your computer and use it in GitHub Desktop.
Save annawinkler/8f5349fec997933498a838787b0e0431 to your computer and use it in GitHub Desktop.
How do I set a breakpoint in my code in PyCharm with docker-compose?

This is a great question! I forget how IDEs have nice features like breakpoints. OK so let's assume you have already started your services via something like docker-compose up. Let's also assume you have already opened your project in PyCharm.

The next thing to do is to configure a remote interpreter for the project as described in the PyCharm documentation.

OK, this next bit is this interesting part. When you add a Run/Debug configuration, let's say you have a Flask application, add a Flask server. When you do this, you'll see the Python interpreter is the remote interpreter! Cool!

One note - because of this issue pipenv does not work for a remote interpreter. Use pip instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment