FROM python:3.10 # Set the working directory to the root of the project WORKDIR /code # Copy requirements and install them globally COPY backend/requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Download NLTK data during the build step so it doesn't slow down startup RUN python -m nltk.downloader stopwords punkt punkt_tab wordnet # Copy the entire backend directory into the container COPY backend /code/backend # Set the working directory to backend so uvicorn can find api.py correctly WORKDIR /code/backend # Hugging Face Spaces requires the app to listen on port 7860 EXPOSE 7860 # Start the FastAPI app on port 7860 CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]