Skip to content
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

Debug Mode #131

Open
jonpeters opened this issue Nov 19, 2021 · 2 comments
Open

Debug Mode #131

jonpeters opened this issue Nov 19, 2021 · 2 comments

Comments

@jonpeters
Copy link

jonpeters commented Nov 19, 2021

Is it possible to set the server into debug mode so that I can attach my IDE (VS Code) to a running container and step through code at development time?

I know that if I was doing this outside of a container, I could start the server explicitly, and provide the debug flag set, e.g.

uvicorn.run(app, host="0.0.0.0", port=8000, debug=True)

I couldn't figure out how to do this using this image.

Thank you!

@nleroy917
Copy link

VSCode (at least mine) has a FastAPI configuration built-in for running with breakpoints. If you go to the debug tab and select a configuration, FastAPI should be an option. You can also choose the option to create a launch.json folder such that when you run in debug with F5, it'll launch the server in a debug environment and it will stop at breakpoints, etc.

I know this isn't really anything to do with the docker container... but that's what I do when I need to stop through.

@avalanche-tm
Copy link

@jonpeters did you figure it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants