【发布时间】:2021-03-18 07:22:40
【问题描述】:
我在 Heroku 和我的 Node / Express / MongoDB 应用程序中遇到以下问题:
XXXX-05-10T22:56:41.782988+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=fast-depths-03410.herokuapp.com request_id=d42d214e-051d-4ba9-842f-ad98cedaf4ab fwd="xxx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes= protocol=https
我在很多帖子中看到这个错误与dyno scale有关,但我认为不是这样。
正如您在以下日志中看到的,应用程序正在运行:
XXXX-05-10T22:41:56.098412+00:00 app[api.1]: yarn run v1.22.5
XXXX-05-10T22:41:56.253837+00:00 app[api.1]: $ node index.js
XXXX-05-10T22:41:57.849610+00:00 app[api.1]: server started on port 23804 (development)
但是当我尝试访问我的 Heroku 应用程序时:https://fast-depths-03410.herokuapp.com/ 我唯一能看到的是消息
应用程序错误检查日志..."
关于我的应用,我尝试了以下方法:
- 我已经用
heroku ps:scale {myapp-name}=1缩放了测功机 - 我已将侦听端口更改为使用
process.env.PORT - 我在我的
Dockerfile中添加了EXPOSE $PORT
问题是什么,我该如何解决?
【问题讨论】:
标签: node.js mongodb docker heroku mongoose