mca_comment_analyzer / Dockerfile
Harshb11's picture
Update Dockerfile
567d707 verified
raw
history blame
1.11 kB
# βœ… Base image with Python 3.9 slim
FROM python:3.9-slim
# Prevent interactive prompts during package installs
ENV DEBIAN_FRONTEND=noninteractive
# Set working directory
WORKDIR /app
# βœ… Install system dependencies (needed for matplotlib, wordcloud etc.)
RUN apt-get update && apt-get install -y \
gcc \
g++ \
wget \
curl \
git \
build-essential \
libglib2.0-0 \
libsm6 \
libxrender1 \
libxext6 \
libgl1 \
&& rm -rf /var/lib/apt/lists/*
# βœ… Copy requirements.txt first (cache optimization)
COPY requirements.txt .
# βœ… Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# βœ… Download NLTK stopwords at build time
RUN python -m nltk.downloader stopwords
# βœ… Copy the source code into container
COPY . .
# βœ… Expose Streamlit port
EXPOSE 7860
# βœ… Environment variables for Streamlit
ENV STREAMLIT_SERVER_PORT=7860 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
STREAMLIT_BROWSER_GATHERUSAGESTATS=false
# βœ… Run Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]