.streamlit/config.toml is not run when docker image is created

Hi all, this is my first post so please excuse me if I do not follow any particular rules/guidelines. I’ve been playing around with streamlit extensively and have currently coded a docker file that creates a docker container and image of my streamlit code.

I wish to increase the file_upload size, which I am aware can be done in the .streamlit/config.toml file. I have tested this on my local host and the changes are reflecting fine, however, as soon as I create my docker images the changes don’t follow across there. I have looked at several other blog posts, specifically Post A and Post B, and have tried both but was unsuccessful. Additionally, I have tried moving the .streamlit folder to the location of the main streamlit page as well as the root folder and that has not worked. Furthermore, I have tried including the following command in my file but that also did not yield anything: --server.maxUploadSize=4000.

This is how my dockerfile is currently set up:

FROM python:3.7.9


COPY /requirements.txt ./

RUN python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip==21.1.1

RUN python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org -r requirements.txt

COPY . /working_directory/

RUN ls


ENTRYPOINT ["streamlit", "run", "./working_directory/src/code/app.py", "--server.port=8501", "--server.address=", "--server.maxUploadSize=4000"]

The following is a very high level view of my folder structure. *NOTE: The folder structure below falls under the working_directory folder that is specified in the dockerfile above.

β”œβ”€β”€ CertEmulationCA.crt  
β”œβ”€β”€ Dockerfile          
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md            
β”œβ”€β”€ requirements.txt      
β”œβ”€β”€ src       
|   |                     
β”‚   β”œβ”€β”€ code
β”‚   β”‚    β”œβ”€β”€ app.py  <-- the main streamlit file that is run
β”‚   β”‚    β”œβ”€β”€ pages  
β”‚   β”œβ”€β”€ data
β”œβ”€β”€ .streamlit
|   |                     
β”‚   β”œβ”€β”€ config.toml

Any help would be much appreciated! :slight_smile:


I think this is the problem, you are starting streamlit from the root folder, but the .streamlit/config.toml is located under /working_directory/ subfolder after the COPY action?


You were 100% correct. Thanks for the observation.

I just added the following code after the COPY . /AiDE/ line in the dockerfile and everything seems to be working as expected: COPY .streamlit/ ./.streamlit/

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.