我正在尝试部署一个使用Tornado服务器用Python编写的Web应用程序。
在我的
app.py
我有
if __name__ == '__main__':
server = tornado.httpserver.HTTPServer(Application())
server.listen(4200, address='0.0.0.0')
tornado.ioloop.IOLoop.instance().start()
然后我有一个程序文件
web: python app.py
当我检查日志时,我看到了错误
2018-08-08T02:20:54.117821+00:00 heroku[web.1]: Starting process with command `python app.py`
2018-08-08T02:20:57.000000+00:00 app[api]: Build succeeded
2018-08-08T02:21:54.891301+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-08-08T02:21:54.891301+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-08-08T02:21:55.027586+00:00 heroku[web.1]: Process exited with status 137
2018-08-08T02:21:55.049407+00:00 heroku[web.1]: State changed from starting to crashed
2018-08-08T02:21:55.051776+00:00 heroku[web.1]: State changed from crashed to starting
2018-08-08T02:21:59.562357+00:00 heroku[web.1]: Starting process with command `python app.py`
我不太清楚自己在做什么,尤其是
Procfile
所以我猜问题就在那里。