FROM python:3.8.10-slim WORKDIR /app # install linux package dependencies RUN apt-get -y update # can copy files only from current working directory where docker builds # cannot copy files from arbitrary directories COPY ./requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # User RUN useradd -m -u 1000 user USER user ENV HOME /home/user ENV PATH $HOME/.local/bin:$PATH WORKDIR $HOME RUN mkdir app WORKDIR $HOME/app COPY ./frontend.py $HOME/app EXPOSE 8501 CMD streamlit run frontend.py \ --server.headless true \ --server.enableCORS false \ --server.enableXsrfProtection false \ --server.fileWatcherType none