Spaces:
Sleeping
Sleeping
| # Use official Python image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| gcc \ | |
| python3-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create necessary directories | |
| RUN mkdir -p /app/models /app/data | |
| # Copy requirements first for better caching | |
| COPY requirements.txt setup.py ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the application files and data | |
| COPY src/ /app/src/ | |
| COPY data/ /app/data/ | |
| COPY run.py /app/ | |
| # Set working directory | |
| WORKDIR /app | |
| # Expose the port Streamlit runs on | |
| EXPOSE 8501 | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONPATH="/app:${PYTHONPATH}" | |
| # Command to run the app | |
| CMD ["streamlit", "run", "run.py", "--server.port=8501", "--server.address=0.0.0.0"] | |