May 19, 2021 PuDB pdb docker-compose Debug Docker RU/EN По-русски

Debugging in docker-compose

It is often necessary to use the debugging tools inside the container, but for this you need to get a full-fledged tty with to interact with the debugger interface via stdin/stdout.

In the note below I will show you how to do this, using this method I run pudb , pdb, ipdb, etc.

You need to add stdin_open: true and tty: true to your service:

version: "3.9"
services:
  api:
    build: .
    stdin_open: true
    tty: true
    ports:
      - "8000:8000"
    volumes:
      - .:/app

Then run it as follows:

docker-compose run --service-ports api

If for some reason you cannot do this, then you can use the wdb

Comments

Post your comment

Markdown