McAbra McAbra - 1 year ago 264
Python Question

Docker-compose and pdb

I see that I'm not the first one to ask the question but there was no clear answer to this:

How to use pdb with docker-composer in Python development?

When you ask uncle Google about

django docker
you get awesome docker-composer examples and tutorials and I have an environment working - I can run
docker-compose up
and I have a neat developer environment but the PDB is not working (which is very sad).

I can settle with running
docker-compose run my-awesome-app python
but then I can access my application over from the host (I can with
docker-compose up
) and it seems that each time I use
new containers are made like:
which I don't desire at all.

People of good will please aid me.


I'm using pdb++ for that example and a basic docker-compose.yml from this django example. Also I experimented but nothing seems to help me. And I'm using docker-composer 1.3.0rc3 as it has Dockerfile pointing support.

Answer Source

Try running your web container with the --service-ports option: docker-compose run --service-ports web

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download