Docker-compose and pdb

前端 未结 3 604
迷失自我
迷失自我 2020-12-12 15:57

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?

W

3条回答
  •  死守一世寂寞
    2020-12-12 16:15

    Use the following steps to attach pdb on any python script.

    Step 1. Add the following in your yml file

    stdin_open: true
    tty: true
    

    This will enable interactive mode and will attach stdin. This is equivalent for -it mode.

    Step 2.

    docker attach 
    

    You'll now get the pdb shell

提交回复
热议问题