5

Streamlit server (run e.g. with streamlit run app-name.py) upon first run for each user requires interaction from her - accepting or rejecting this intro message:

  Welcome to Streamlit!

  If you are one of our development partners or are interested in
  getting personal technical support, please enter your email address
  below. Otherwise, you may leave the field blank.

  Email:

Streamlit then waits for input, failing to daemonize (run in background), which quickly causes docker containers in Kubernetes or Openshift to crash (enter the famous crash-loop back off procedure).

How to avoid such crashing, by running Streamlit in headless/noninteractive mode?

mirekphd
  • 4,799
  • 3
  • 38
  • 59

1 Answers1

8

In the streamlit documentation you can find a detailed list of configurable options. Scroll down and you will find the headless option. Just edit the config file.

headless = true

Please also refer to this post.

YScharf
  • 1,638
  • 15
  • 20
  • 1
    Excellent! As seen from your 2nd link, Streamlit is so versatile, that it does not even require shipping a custom config file inside the container. You can do it with an env var (`STREAMLIT_SERVER_HEADLESS=true`) or a parameter passed to the server (`streamlit run your_app.py --server.headless true`). – mirekphd Apr 25 '22 at 14:25