Spaces:
Sleeping
Sleeping
| # Use the official Hugging Face Spaces base image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /home/user/app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir "numpy<2.0.0" && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy the application code | |
| COPY . . | |
| # Create user | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Expose the port that Streamlit runs on | |
| EXPOSE 7860 | |
| # Set environment variables for Streamlit | |
| ENV STREAMLIT_SERVER_PORT=7860 | |
| ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 | |
| ENV STREAMLIT_SERVER_HEADLESS=true | |
| ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false | |
| # Run the Streamlit app | |
| CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |