Spaces:
Running
Running
FROM python:3.10-slim | |
RUN apt-get update && apt-get install -y build-essential curl git && rm -rf /var/lib/apt/lists/* | |
WORKDIR /app | |
# Create non-root user | |
RUN useradd -m -u 1000 user | |
# Create a directory for the GitHub repo and ensure it has the correct permissions | |
RUN mkdir /app/github_repo && chown -R user:user /app/github_repo | |
# Switch to the non-root user | |
USER user | |
# Copy application files as the non-root user to avoid permission issues | |
COPY --chown=user:user . /app | |
# Install dependencies, ensuring the streamlit executable is in PATH | |
# Ensure the requirements.txt is present and correctly referenced here | |
RUN pip install --upgrade pip && pip install --user -r requirements.txt | |
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |