question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using environment variables to set settings ~(does not work properly)~ error in documentation

See original GitHub issue

I used the following Dockerfile to build an image of my streamlit app:

FROM continuumio/miniconda3:latest
WORKDIR /app
COPY . /app/
RUN conda config --add channels conda-forge \
    && conda env create -n myapp -f environment.yml \
    && rm -rf /opt/conda/pkgs/*
ENV STREAMLIT_CONFIG_SERVER_PORT=8050
CMD conda run -n myapp streamlit run app.py

However, if I try to use port forwarding to access the container, then port 8050 does not work. Conversely, if I use --server.port=8050 in the last line, it does work.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nthmostcommented, Jan 24, 2020

Just confirming: the line of code pertaining to the syntax of env variables is here in cli.py:

envvar = "STREAMLIT_{}".format(to_snake_case(param).upper())
1reaction
gregsadetskycommented, Apr 21, 2022

Extremely small point to anyone coming here (as I did) to see how to set a config option via an environment variable:

Don’t forget to include the config section name in the environment variable name! For example:

export STREAMLIT_RUNNER_MAGIC_ENABLED = "False"

i.e. “RUNNER” here is the same as the “[runner]” section name in the .toml file. This must be included, otherwise the environment variable will be ignored / the config option will not be set.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Office error “could not create the work file” - Microsoft Learn
Add an Environment Variable · Select Start > Settings > System > About. · Scroll down to Related settings, and then select Advanced...
Read more >
How to setup environment variables for `flask run` on Windows?
I don't know how to setup the environment variables. Whenever I use the flask run command, I encounter the following error: Error message...
Read more >
Introduction to environment variables - CircleCI
Use environment variables to set up various configuration options, and keep your set-up secure with secrets, private keys, and contexts.
Read more >
Environment variables in Compose | Docker Documentation
When you run docker-compose up with this configuration, Compose looks for the POSTGRES_VERSION environment variable in the shell and substitutes its value in....
Read more >
How to Use Environment Variables in App Platform
To set a bindable variable as an environment variable, go to the Apps section of the DigitalOcean Control Panel. Click your app, then...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found