Docker-compose 和 pdb [英] Docker-compose and pdb
问题描述
我知道我不是第一个提出这个问题的人,但对此没有明确的答案:
如何在Python开发中使用pdb和docker-composer?
当你向 Google 叔叔询问 django docker
时,你会得到很棒的 docker-composer 示例和教程,我有一个工作环境 - 我可以运行 docker-compose up
并且我有一个整洁的开发人员环境但 PDB 不工作(这很可悲).
我可以通过运行 docker-compose run my-awesome-app python app.py 0.0.0.0:8000
来解决,但随后我可以通过 http://127.0.0.1:8000(我可以使用 docker-compose up
)并且似乎每次我使用 run
新容器制作如下: dir_app_13
和 dir_db_4
我根本不想要.
好心人请帮助我.
PS
我在该示例中使用 pdb++ 和来自 this django example 的基本 docker-compose.yml.我也尝试过,但似乎没有任何帮助.我正在使用 docker-composer 1.3.0rc3 因为它具有 Dockerfile 指向支持.
尝试使用 --service-ports 选项运行您的 Web 容器:docker-compose run --service-ports web
>
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 app.py 0.0.0.0:8000
but then I can access my application over http://127.0.0.1:8000 from the host (I can with docker-compose up
) and it seems that each time I use run
new containers are made like: dir_app_13
and dir_db_4
which I don't desire at all.
People of good will please aid me.
PS
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.
Try running your web container with the --service-ports option: docker-compose run --service-ports web
这篇关于Docker-compose 和 pdb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!