Lets assume I have the following docker-compose.yml file running two different python apps in parallel (e.g. via flask):
app1:
command: python app.py
build: app1/
app2:
command: python app.py
build: app2/
links:
- app1
app2 is linked to app1 since I want to get particular data from app1 within it. Now my problem is a certain scenario where I want to debug this link. I can easily debug app1 and app2 as standalone containers (via docker-compose run --service-ports ... python app.py and placing pdb somewhere in the code). My problem is when I want to debug app1 in case the request comes from app2. If I start app1 with docker-compose run, then app2 is not able to resolve the link. This issue becomes even more a problem with more apps/services "talking" to each other depending on their links.
Is there a good way to handle this? How do you approach the debug problem with linked containers in general (not necessarily python specifc)? Thanks for the input.