julian-schelb's picture
Update Dockerfile
6288b0f verified
# ─────────────────────────── 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"]