I use python, flask, celery, docker and docker compose in my project and wanted to use celery rdb to debug my tasks. I could not connect to celery container using telnet from my local machine to docker container.
I could not find an easy way to do it. Finally I ended up with followings:
# install system dependencies
RUN apt-get update && apt-get install -y telnet
docker compose exec my_celery bash
root@fc4dcaa378xy:/usr/src/app# telnet 0.0.0.0 6900
Trying 0.0.0.0...
Connected to 0.0.0.0.
Escape character is '^]'.
> /usr/src/app/api/tasks.py(55)my_task()
-> scraper_res = myfunc(url, *args, **kwargs)
(Pdb) pp locals()