Spaces:
Runtime error
Runtime error
# Use the official Python image from the Docker Hub | |
FROM python:3.10 | |
# Install system dependencies | |
RUN apt-get update && \ | |
apt-get install -y \ | |
poppler-utils \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Set up working directory | |
WORKDIR /code | |
# Copy the current directory contents in the container /code | |
COPY requirements.txt /code/requirements.txt | |
# Install the requirements.txt | |
RUN pip install --no-cache-dir /code/requirements.txt | |
# set up a new user named "user" | |
RUN useradd user | |
# switch to the "user" user | |
USER user | |
# set home to user home directory | |
ENV HOME = /home/user \ | |
PATH = /home/user/.local/bin:$PATH | |
# SET THE WORKING DIRECTORY TO THE USER'S HOME DIRECTORY | |
WORKDIR $HOME/app | |
# Copy the current directory contents into the container at $HOME /app setting owner to user | |
COPY --chown=user . $HOME/app | |
# Start the streamlit app on 7860 | |
CMD ["streamlit", "run", "app.py"] | |