FROM python:3.13.5-slim WORKDIR /app # Install OS-level dependencies including ffmpeg and OpenCV requirements RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ ffmpeg \ libsm6 \ libxext6 \ libfontconfig1 \ libxrender1 \ libgl1-mesa-glx \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Copy dependency spec and source code COPY requirements.txt ./ COPY . ./ # Install Python dependencies RUN pip3 install --no-cache-dir -r requirements.txt # Set environment variables for Streamlit and Keras ENV STREAMLIT_HOME=/tmp/.streamlit ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false ENV KERAS_BACKEND=torch ENV OPENCV_LOG_LEVEL=ERROR # Expose the port used by Streamlit EXPOSE 8501 # Healthcheck: test whether Streamlit's health endpoint is alive HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health # Launch Streamlit app; bind to 0.0.0.0 so external connections work ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]