If you containerize your Python application using docker-compose.yml
, you can easily run and debug the application in PyCharm. Before starting, ensure that no related Docker containers or Python apps are running and occupying the (exposed) ports.
- Open PyCharm
- Go to: Add New Interpreter
- Pick: On Docker Compose
- Pick Server: Docker
- Pick Configuration files:
./docker-compose.yml
- Pick Service:
name of the service you want to start and debug
- Set Environment Variables: add some env vars if desired and not covered by the
docker-compose.yml
orDockerfile
and click next