我刚刚使用 Docker 将一个新项目部署到 Heroku。
不幸的是,我的 dyno 处于重启周期,还没有上线。它不断崩溃并显示以下日志:
2021-01-07T09:49:55.706527+00:00 heroku[web.1]: Process exited with status 143
2021-01-07T09:51:44.917593+00:00 heroku[web.1]: Starting process with command `/bin/sh -c NODE_ENV\=production\ node\ ./dist/apps/server/main.js`
2021-01-07T09:51:45.800006+00:00 heroku[web.1]: State changed from starting to down
2021-01-07T09:51:45.802340+00:00 heroku[web.1]: State changed from down to starting
2021-01-07T09:51:54.256090+00:00 app[web.1]: Listening on :39134
2021-01-07T09:51:55.807447+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-01-07T09:51:56.049759+00:00 heroku[web.1]: Process exited with status 143
2021-01-07T09:52:09.979061+00:00 heroku[web.1]: Restarting
2021-01-07T09:53:18.197373+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=my-app.herokuapp.com request_id=a031ff96-2a06-46e0-85da-458f83430f0d fwd="49.178.36.98" dyno= connect= service= status=503 bytes= protocol=https
2021-01-07T09:53:33.346139+00:00 heroku[web.1]: Starting process with command `/bin/sh -c NODE_ENV\=production\ node\ ./dist/apps/server/main.js`
2021-01-07T09:53:39.162417+00:00 app[web.1]: Listening on :45111
2021-01-07T09:53:40.774891+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2021-01-07T09:53:40.887655+00:00 heroku[web.1]: Process exited with status 143
我尝试将测功机升级到 Hobby
,多次重启所有测功机,但似乎没有任何解决办法。
我确实在听process.env.PORT
。