我已成功部署 Flask 應用程式,但當我單擊 herokuapp 鏈接時出現應用程式錯誤。當我檢查日志時,它顯示了這樣的內容
2022-01-03T12:52:35.000000 00:00 app[api]: Build started by user
2022-01-03T12:53:02.508102 00:00 app[api]: Deploy 8a785469 by user
2022-01-03T12:53:02.508102 00:00 app[api]: Release v4 created by user
2022-01-03T12:53:03.794631 00:00 heroku[web.1]: State changed from crashed to starting
2022-01-03T12:53:07.748702 00:00 heroku[web.1]: Starting process with command `waitress-serve --call flaskr:create_app`
2022-01-03T12:53:09.003519 00:00 app[web.1]: INFO:waitress:Serving on http://0.0.0.0:8080
2022-01-03T12:53:12.000000 00:00 app[api]: Build succeeded
2022-01-03T12:54:08.177780 00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2022-01-03T12:54:08.255635 00:00 heroku[web.1]: Stopping process with SIGKILL
2022-01-03T12:54:08.406812 00:00 heroku[web.1]: Process exited with status 137
我也用過 heroku ps:scale web=1
我的 Procfile 包括:
web: waitress-serve --call flaskr:create_app
uj5u.com熱心網友回復:
您必須提供要系結的埠(您不能使用默認的 8080)
web: waitress-serve --port=$PORT --call 'flaskr:create_app'
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/403766.html
標籤:
