File size: 1,683 Bytes
ca8d858
6288b0f
446f799
ca8d858
446f799
 
ca8d858
 
 
 
 
446f799
 
ca8d858
446f799
ca8d858
446f799
9202135
495243a
9202135
 
446f799
ca8d858
 
446f799
ca8d858
 
 
 
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
# ─────────────────────────── base image ───────────────────────────
FROM python:3.11-slim

# ────────────────────────── work directory ────────────────────────
WORKDIR /app

# ──────────────────── system deps (lean install) ──────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential \
        curl \
        git \
    && rm -rf /var/lib/apt/lists/*

# ───────────────────── python deps first for cache ────────────────
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt

# ─────────────── download NLTK data into an app-local dir ─────────
ENV NLTK_DATA=/app/nltk_data
RUN mkdir -p ${NLTK_DATA} \
 && python -m nltk.downloader -d ${NLTK_DATA} stopwords punkt

# ──────────────────────── copy source code ────────────────────────
COPY src/ ./src/

# ─────────────────────────── streamlit run ────────────────────────
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]