Replies: 5 comments
-
Hey @lowercase00, I'd suggest trying to blend what gets created by "Add Docker Files to Workspace..." with your solution. For example, in order to facilitate Python debugging along with the "Python: Remote Attach" configuration you have created, we create a As an example, here's a version: '3.4'
services:
flasktest:
image: flasktest
build:
context: .
dockerfile: ./Dockerfile
command: ["sh", "-c", "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m flask run --no-debugger --no-reload --host 0.0.0.0 --port 5000"]
ports:
- 5000:5000
- 5678:5678
environment:
- FLASK_APP=manage.py That command in particular is significantly different from what appears in For our normal Flask scenario, to debug you'd right click and Compose Up that |
Beta Was this translation helpful? Give feedback.
-
@bwateratmsft let me see if understood your point correctly. ./.vscode/launch.json
./docker-compose.yml
./docker-compose.override.yml
Then I just right-click on my original When I run I'm definitely missing something, but I'm really confused as to what, and how to properly setup. Thanks! |
Beta Was this translation helpful? Give feedback.
-
At this point you won't need to do
As for the command I don't know for sure how your app is started, I'll assume The other thing to note is that the behavior will be different if you right click In the case of debugging, you want to have that |
Beta Was this translation helpful? Give feedback.
-
Hey @lowercase00, would you mind providing us minimum repro steps from the start of your project? Or a repo? It would help us to recreate this scenario so we can move forward with looking into fixes. We're also wondering if Compound Launch Configs are what you're looking for to debug multiple containers you want to attach to. Let us know 👍🏽 |
Beta Was this translation helpful? Give feedback.
-
Changing this over to a Discussion, we want to try using that new feature from GitHub! |
Beta Was this translation helpful? Give feedback.
-
Hey all. I was wondering if you guys could help shed some light debugging a project with a few containers.
I basically have:
app.ini
uwsgi)All in a
docker-compose.yml
file. Before moving the project to containers, I would just use the Debugger regularly with as a Flask App, which really helps during development, but can't seem to find a way to do that in my current setup.I've seen this question and one of the answers says:
But I don't really understand how to do that. If I press F5 the "Add Docker" options pops up, but it makes a whole new
requirements.txt
,Dockerfile
anddocker-compose.yml
file, I don't get it. Should. I don't get how that works? The containers are already up (right clicking mydocker-compose.yml
and 'Docker Compose Up` ).I created a launch.json configuration with
attatch
request, like:After running the containers (docker-compose up -d) I went to the debugger and clicked "play", but nothing happens. I just wanted to run my code step by step with breakpoints and all. Ideally, I would like to be able to debug both Flask, and Celery tasks, so probably would want to attach de debugger to multiple processes?
Any ideas that could be of any help?
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions