File size: 802 Bytes
e097814
6f60b44
 
496c963
 
 
 
 
6f60b44
 
 
 
 
 
 
 
 
e097814
 
 
6f60b44
 
 
 
 
 
 
 
e097814
 
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
26
27
28
29
30
31
# Use an official Python runtime as a parent image
FROM python:3.9-slim

# --- ADD THIS LINE ---
# Set the Hugging Face cache directory to a writable location.
# This prevents permission errors when the model is downloaded.
ENV HF_HOME /tmp

# Set the working directory in the container
WORKDIR /code

# Copy the requirements file into the container
COPY requirements.txt .

# Install the Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Pre-download the NLTK 'punkt' tokenizer during the build process
RUN python -m nltk.downloader punkt

# Copy your application code into the container
COPY . .

# Tell Docker that the container listens on port 7860
EXPOSE 7860

# The command to run your app when the container starts
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]