擅长:python、mysql、java
<p>这个问题有点老了,但无论如何。。。</p>
<p>在缩放dynos之前,需要有一个Procfile,在这里定义启动进程时应该发生的事情。在您的情况下,这个过程应该称为<code>web</code>。我们一会儿来看看文件的内容。</p>
<p>但首先:在我看来,最好使用gunicorn在heroku上运行python应用程序,所以首先应该安装gunicorn,运行<code>pip freeze > requirements.txt</code>,并将其推送到heroku(好吧,等你有了Procfile之后再安装)。有关详细信息,请参见:<a href="https://devcenter.heroku.com/articles/python-gunicorn" rel="noreferrer">python with gunicorn on heroku</a></p>
<p>Procfile只需要一行<code>web: gunicorn <filename>:<main method name></code>。在您的情况下,这将是(假设您的主要方法称为“app”)<code>web: gunicorn bot:app</code>。</p>
<p>现在把所有这些都推到heroku上,然后您就可以使用使用<code>heroku ps:scale web=1</code>的命令来缩放dyno了</p>