Docker-compose and pdb

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 <generated_containerid>

You’ll now get the pdb shell

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)