gli / Dockerfile
educrpg's picture
Update Dockerfile
7e212d4 verified
raw
history blame contribute delete
938 Bytes
# Dockerfile
FROM python:3.13.5-slim
ENV PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# System deps (trim if you don't need build tools)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python deps first for better layer caching
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# ensure requirements.txt includes: streamlit
# App code
COPY src/ ./src/
# (Optional) run as non-root
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser
EXPOSE 8501
HEALTHCHECK CMD curl --fail --silent --show-error http://localhost:8501/_stcore/health || exit 1
# Use CMD (not ENTRYPOINT) and call streamlit as a module to avoid PATH issues
CMD ["python", "-m", "streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]