Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Install system dependencies required for compiling some Python packages | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| cmake \ | |
| rustc \ | |
| cargo \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy the requirements file into the container | |
| COPY backend/requirements.txt /app/requirements.txt | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN python -m spacy download en_core_web_sm | |
| # Copy the entire backend directory into the container | |
| COPY backend/ /app/backend/ | |
| # Copy the data directory into the container | |
| COPY data/ /app/data/ | |
| # Set the working directory to the backend so the paths match your code | |
| WORKDIR /app/backend | |
| # Run the FastAPI server on port 7860 (Hugging Face Spaces default port) | |
| CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"] |