April 29, 2017
November 25, 2019
How to use Docker with PyCharm
What you need is:
- Docker - https://docs.docker.com/engine/installation/
- docker-compose - https://docs.docker.com/compose/install/
- PyCharm ;-)
I use PyCharm in 2017.12 version but even with previous ones this tutorial should work correctly.
First you need to configure Docker. Go to File -> Settings and find Docker section (you can use search bar).
Just add a new Docker, fill the API URL and Docker Compose executable inputs. When everything is added correctly you should see a "Connection successful" message.
Now you need to configure Docker all your projects. Once again go to the settings, find project configuration and choose "Project Interpreter" section.
Click settings icon and choose "Add Remote".
- Server: choose the correct Docker configuration
- Configuration file(s): Add a paths to your project docker-compose.yml files
- Service: Choose Docker service/container which should be used
Now you need to wait some time because PyCharm needs to build own Docker container and scan everything. After that operation PyCharm should be able see every package installed in the container and you should be able to use for example "Go To" command or Docker tools from Pycharm.