FROM python:3.10-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y git libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/* # Copy and install requirements COPY requirements.txt . # Install lighter dependencies first, skip heavy ones that might fail RUN pip install --no-cache-dir streamlit plotly pandas numpy pillow opencv-python-headless matplotlib scikit-learn scipy tqdm pyyaml # Install torch (CPU only for HF free tier) RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu # Install remaining packages RUN pip install --no-cache-dir streamlit-drawable-canvas streamlit-option-menu einops timm # Copy application code COPY . . # Expose port EXPOSE 7860 # Create streamlit config RUN mkdir -p .streamlit && echo "[server]\nheadless = true\nenableCORS = false\nenableXsrfProtection = false\nport = 7860\naddress = \"0.0.0.0\"" > .streamlit/config.toml # Run the app CMD ["python", "-m", "streamlit", "run", "streamlit_app/app.py"]