-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support docker compose and dockerfile for vscode debug mode. #5451
Comments
Creating separate Docker Compose and Django Dockerfile configurations specifically for VS Code debug mode using debugpy sounds like a practical approach. Having these settings would indeed help developers who use different environments like WSL or other operating systems. However, instead of adding entirely new files, maybe we could explore adding conditional settings or comments within the existing Docker Compose and Dockerfile to keep things more organized. That way, we could support the VS Code debugger setup without cluttering the project with multiple files. What do you think? |
Thanks for great insight! As you said, If we can add conditional settings within the Docker Compose and Dockerfile, It's best. Your second suggestion(working with comments) is not great.. It makes user confusing first using cookiecutter-django. If it's experimental function , It would be OK. but production level comment / comment out for logic is not great option. I hope your opinion again :) |
I tried conditional settings for vscode remote debug with docker.
And we can easily turn on by command
And then that vaule will determine whether remote debug mode or not in dockerfile and start script. It works well in my local machin(wsl ubuntu 22.04 and vscode remote debugger) I guess PR should include code changes to create docker-compose / dockerfile / start script, also document for how to use. How do you think this idea? |
@quroom would love to see how you implemented this. In particular the launch.json file. |
@1beb This is what you asked. launch.json is almost same as default.
|
This approach seems very practical! By using the DEBUGPY_ON argument and conditional settings, it provides a clean way to toggle the VS Code debugger functionality without introducing extra files. I like how you've made it easy to switch between debug and regular modes via the environment variable. The use of conditional installation of debugpy and the custom start script ensures that it’s only added when needed, keeping things lightweight. Including documentation on how to use the setup is a great idea, as it will make it easy for others to integrate this into their workflows. I think your idea for a PR is solid—adding the necessary Docker Compose, Dockerfile, and start script changes along with the usage instructions will definitely be helpful to others. Looking forward to seeing the PR! |
Description
What are you proposing? How should it be implemented?
Create diffrent docker compose and django dockerfile for vscode debug mode with debugpy like official docker compose debug setting
It would be slightly different.
But I am not sure adding different files are best way for vscode debugger preset.
However I am sure it's helpful who faces same issue in wsl or another os.
Rationale
Why should this feature be implemented?
#2540 ,
The text was updated successfully, but these errors were encountered: