如何在容器中与Gunicorn一起运行的烧瓶应用程序?
我一直在寻找一种启动Python调试器的方法,以便我可以调试烧瓶应用程序,该应用程序在Docker容器中被Gunicorn执行,然后从外部与我的Vscode连接。
但是我找不到任何解决方案。实际上,某人在这里表明根本不可能吗?
有没有办法调试由枪支执行的烧瓶应用程序?
I have been looking for a way to start a python debugger so I can debug my flask app which is being executed with gunicorn inside a docker container and then connect to it with my VSCode from outside.
But I dont find any solutions. In fact someone here suggests that it is not possible at all?
Is there a way to debug my flask app executed by gunicorn?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,与枪支有关,看起来这是非常困难的,即使不是不可能的ATM。因此,我所做的是
degub_app.py
文件docker-compose
file:VSCODE
与远程容器
插件I连接到该容器上。这启动了一个新的VSCODE窗口,并向您显示容器内的文件。Note 由于VScode现在已连接到我必须重新安装Python扩展程序的容器(您可以查找此功能,但是很容易,只需转到插件,然后重新安装到容器),
启动.json
在容器中以运行我上面提到的degub_app.py
:So it looks like this is very difficult, if not impossible atm, to do with gunicorn. So what I did was
degub_app.py
file in my project with :docker-compose
file:VSCode
with theRemote Container
pluggin i attached to that container. This starts a new VSCode window and shows you the files inside the container.Note Since the VSCode is now connected to the container I had to re-install the Python extension (you can look this up but it is easy just go to pluggins and re-install to container)
launch.json
inside the container to run thedegub_app.py
that I mentioned above like this: