File size: 761 Bytes
912ab32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10a9abe
 
 
 
 
 
 
912ab32
9a4b505
912ab32
 
 
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
# Use an official Python runtime as the base image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Copy the application files to the container
COPY app.py .
COPY templates/ ./templates/
COPY model.pkl .
COPY vectorizer.pkl .

# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Download NLTK data (stopwords, punkt) to a specific directory
RUN mkdir -p /app/nltk_data && \
    python3 -m nltk.downloader -d /app/nltk_data stopwords punkt

# Set the NLTK_DATA environment variable to use the downloaded data
ENV NLTK_DATA=/app/nltk_data

# Expose the port the app will run on
EXPOSE 7860

# Command to run the application
CMD ["python", "app.py"]