Config.toml not being used on AWS (Elastic Beanstalk and Docker)

I’ve built a streamlit app to run in a docker container with the following Dockerfile:

# Use an official Python 3.11 runtime as a parent image
FROM python:3.11.7-slim

# Set the working directory
WORKDIR /usr/src/my-app

# RUN pip install --no-cache-dir -r ./requirements.txt
COPY ./requirements.txt ./
RUN pip install --no-cache-dir -r ./requirements.txt

# Add the parent directory contents into the container
ADD . /usr/src/my-app
COPY ./wc_app/.streamlit /usr/src/my-app/wc_app/.streamlit

RUN pip install -e ./

#-- This redirects the output to the terminal
ENV PYTHONUNBUFFERED=1
ENV PYTHONIOENCODING=UTF-8

# Make port 8501 available to the world outside this container
EXPOSE 8501

CMD ["streamlit", "run", "./wc_app/main.py", "--server.port", "8501", "--", "-c", "./wc_app/app_config.py"]

When I run the docker image locally, the config file is picked up and used when viewing the app in a browser. When I inspect the files in the container, it shows the ./wc_app/.streamlit/config.toml file so all is good locally.

When I deploy to AWS (Elastic Beanstalk) and view the app, the config file is not being used.

Any ideas on how to solve this?

Thanks

1 Like