【问题标题】:PM2.js to Run Gunicorn/Flask App inside Virtualenv/Anaconda envPM2.js 在 Virtualenv/Anaconda 环境中运行 Gunicorn/Flask 应用程序
【发布时间】:2021-05-22 03:46:03
【问题描述】:

我一直在运行 gunicorn 以使用命令为 Python Flask 应用程序提供服务

conda activate fooenv
gunicorn --workers=4 -b 0.0.0.0:5000 --worker-class=meinheld.gmeinheld.MeinheldWorker api.app:app 

我们如何使用pm2fooenv 环境中运行 gunicorn/flask 应用程序?

【问题讨论】:

    标签: python flask conda gunicorn pm2


    【解决方案1】:

    假设您可以通过例如:

    在您的 venv 中运行 gunicorn
    gunicorn wsgi:app -b localhost:5010
    

    然后您只需使用命令(在 venv 中):

    pm2 --name=myapp start "gunicorn wsgi:app -b localhost:5010"
    

    (顺便说一句,我花了很长时间才弄清楚)

    【讨论】:

      猜你喜欢
      • 2022-01-15
      • 2012-02-15
      • 2017-09-30
      • 1970-01-01
      • 1970-01-01
      • 2022-01-18
      • 1970-01-01
      • 1970-01-01
      • 2019-10-04
      相关资源
      最近更新 更多