Check_2 / Dockerfile
sid22669's picture
Update Dockerfile
9a4b505 verified
raw
history blame contribute delete
761 Bytes
# 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"]