Mem*_*eng 1 cloud data-visualization heroku plotly streamlit
我在 Heroku 上构建一个 Web 应用程序并遇到了这个问题:
2020-10-24T03:56:57.857273+00:00 app[web.1]: You can now view your Streamlit app in your browser.
2020-10-24T03:56:57.857320+00:00 app[web.1]:
2020-10-24T03:56:57.857675+00:00 app[web.1]: Network URL: http://172.17.131.6:8501
2020-10-24T03:56:57.857819+00:00 app[web.1]: External URL: http://34.202.9.122:8501
2020-10-24T03:56:57.857932+00:00 app[web.1]:
2020-10-24T03:56:59.458188+00:00 app[web.1]: 2020-10-24 03:56:59.458 Generating new fontManager, this may take some time...
2020-10-24T03:57:41.000000+00:00 app[api]: Build succeeded
2020-10-24T03:57:52.127634+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-10-24T03:57:52.147741+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-10-24T03:57:52.252583+00:00 heroku[web.1]: Process exited with status 137
2020-10-24T03:57:52.301275+00:00 heroku[web.1]: State changed from starting to crashed
2020-10-24T03:57:53.705631+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=okc-thunder-rebounds.herokuapp.com request_id=a90bb347-f583-4bec-8a6c-37bfea93908e fwd="71.232.30.113" dyno= connect= service= status=503 bytes= protocol=https
Run Code Online (Sandbox Code Playgroud)
我的 setup.sh 是这样的:
mkdir -p ~/.streamlit/
echo "\
[general]\n\
email = \"qemail@domain.com\"\n\
" > ~/.streamlit/credentials.toml
echo "\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
" > ~/.streamlit/config.toml
Run Code Online (Sandbox Code Playgroud)
我的 Procfile 是这样的:
web: sh setup.sh && streamlit run rebound_app.py
Run Code Online (Sandbox Code Playgroud)
哪里出了问题?
应用程序必须通过 env 变量绑定到 Heroku 提供的端口$PORT。这是每个 Web Dyno 的要求。
您需要传递 $PORT 来进行 Streamlit
echo PORT $PORT
streamlit run --server.port $PORT rebound_app.py
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
993 次 |
| 最近记录: |