Spaces:
Sleeping
Sleeping
| FROM python:3.9-slim | |
| # Install system dependencies for building Python packages | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Install blis separately to avoid long build times | |
| RUN pip install --no-cache-dir blis==0.7.9 | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --prefer-binary -r requirements.txt | |
| # β Download spaCy language model | |
| RUN python -m spacy download en_core_web_sm | |
| # Copy the rest of your app | |
| COPY . . | |
| # Expose the port expected by Hugging Face Spaces (7860 or 5000) | |
| EXPOSE 7860 | |
| # Set Flask environment variables | |
| ENV FLASK_APP=app.py | |
| ENV FLASK_RUN_PORT=7860 | |
| ENV FLASK_RUN_HOST=0.0.0.0 | |
| # Run the Flask app | |
| CMD ["flask", "run"] | |