mca_comment_analyzer / Dockerfile
Harshb11's picture
Update Dockerfile
6148c31 verified
raw
history blame
1.24 kB
# -----------------------------
# Base image with Python 3.9
# -----------------------------
FROM python:3.9-slim
# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Set working directory
WORKDIR /app
# -----------------------------
# System dependencies for NLTK, Matplotlib, WordCloud
# -----------------------------
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 and install Python packages
# -----------------------------
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Download NLTK stopwords
RUN python -m nltk.downloader stopwords
# -----------------------------
# Copy source code
# -----------------------------
COPY . .
# Expose Streamlit port
EXPOSE 7860
# Set Streamlit environment variables
ENV STREAMLIT_SERVER_PORT=7860 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
# -----------------------------
# Command to run Streamlit
# -----------------------------
CMD ["streamlit", "run", "app.py"]