# Dockerfile for Hugging Face Spaces - Streamlit App FROM python:3.10-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements first (for better caching) COPY requirements.txt requirements.txt # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy entire project COPY . . # Create output directories with proper permissions RUN mkdir -p /app/eda/output/graph_data && \ mkdir -p /app/eda/output/checkpoints && \ mkdir -p /app/eda/output/logs && \ mkdir -p /app/output && \ chmod -R 777 /app/eda/output && \ chmod -R 777 /app/output && \ touch /app/eda/probe_prompts.log && \ chmod 666 /app/eda/probe_prompts.log # Set environment variables for Streamlit ENV STREAMLIT_SERVER_HEADLESS=true ENV STREAMLIT_SERVER_FILE_WATCHER_TYPE=none ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false ENV HOME=/app # Expose Streamlit port EXPOSE 7860 # Health check HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health # Run Streamlit app directly from eda directory WORKDIR /app/eda ENTRYPOINT ["streamlit", "run", "app.py", \ "--server.port=7860", \ "--server.address=0.0.0.0", \ "--server.enableXsrfProtection=false", \ "--server.enableCORS=false", \ "--server.maxUploadSize=200"]