File size: 755 Bytes
1a799bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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"]