Spaces:
Runtime error
Runtime error
File size: 990 Bytes
da3b9bf de7cb3b da3b9bf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# 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 the working directory
WORKDIR /code
# Copy the current directory contents into the container
COPY requirements.txt /code/requirements.txt
# Install the requirements from the requirements.txt
RUN pip install --no-cache-dir -r /code/requirements.txt
# Create a new user and switch to it
RUN useradd -m user
USER user
# Set the environment variables for the user's home and path
ENV HOME=/home/user \
PATH=$HOME/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Copy the current directory contents into the container's $HOME/app folder, setting owner to user
COPY --chown=user . $HOME/app
# Copy the .env file into the container
COPY --chown=user .env $HOME/app/.env
# Start the Streamlit app
CMD ["streamlit", "run", "app.py"]
|