File size: 731 Bytes
0b5fa25
 
 
 
 
 
 
 
 
 
0f9f853
0b5fa25
5c3c401
 
 
 
 
 
 
 
 
0b5fa25
 
 
0f9f853
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Use the official Python 3.10.9 image
FROM python:3.10.9

# Copy the current directory contents into the container at .
COPY . .

# Set the working directory to /
WORKDIR /app

# Install requirements.txt 
RUN pip install --upgrade pip --no-cache-dir --upgrade -r requirements.txt

ENV TRANSFORMERS_CACHE=/app/cache
ENV HF_HOME=/app/cache
RUN mkdir -p /app/cache && chmod 777 /app/cache

# download nltk data
RUN python3 -c "import nltk; nltk.download('punkt_tab')"
RUN python3 -c "import nltk; nltk.download('wordnet')"
RUN python3 -c "import nltk; nltk.download('stopwords')"

EXPOSE 7860

# Start the FastAPI app on port 7860, the default port expected by Spaces
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]