I'd like to point out that if you're using Python with the pdb debugger:
import pdb; pdb.set_trace()
It will not drop to the shell if you execute your script using:
docker-compose up
However if you use run, it will drop down to the debugger as expected:
docker-compose run