Summary
We run Streamlit on an internal host under Docker (actually podman).
We need to access environment variables not in a file from inside the app.
Question
How can we make the environment from the Docker container available to Streamlit? We would prefer not having to store the data in a config file and import them but simply to rely on the environment we run the app in.
When developing, we typically put data in .env and we can import it using the python-dotenv call load_dotenv(). But for production, we need to be able to get the same information from the environment directly.
Today, Streamlit seems only to show its own environment without inclusions from the initializing enviroment.
To reproduce:
print(os.environ) inside the streamlit app will not show any variables form the host.
Debug info
- Streamlit version: 1.27.1
- Python version: 3.10.12
- OS version: Ubuntu 20.04