# Use BuildKit for better caching: DOCKER_BUILDKIT=1 | |
FROM python:3.10-slim | |
ENV PYTHONUNBUFFERED=1 | |
WORKDIR /home/user/app | |
# System dependencies | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends git git-lfs ffmpeg libsm6 libxext6 libgl1-mesa-glx && \ | |
rm -rf /var/lib/apt/lists/* && \ | |
git lfs install | |
# Upgrade pip | |
RUN pip install --no-cache-dir pip setuptools | |
# Copy requirements and install (cached unless requirements.txt changes) | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy rest of source | |
COPY . . | |
# Expose default Streamlit port (change if using Flask) | |
EXPOSE 8501 | |
# Default command: run Streamlit. If using Flask instead, adjust to ["python", "app.py"] | |
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.enableCORS=false"] | |