# NOVA AI - Full Stack Docker Image # Base: Python 3.11 slim FROM python:3.11-slim # System dependencies for AutoGluon, PyTorch, etc. RUN apt-get update && apt-get install -y \ build-essential \ gcc \ g++ \ git \ libgomp1 \ libopenblas-dev \ curl \ && rm -rf /var/lib/apt/lists/* # Working directory WORKDIR /app # Install Python requirements in layers (for Docker cache efficiency) # Heavy ML libs first (cached if unchanged) RUN pip install --no-cache-dir \ torch torchvision --index-url https://download.pytorch.org/whl/cpu RUN pip install --no-cache-dir \ autogluon.tabular \ autogluon.multimodal # Then lighter dependencies RUN pip install --no-cache-dir \ flask \ flask-cors \ pandas \ numpy \ scikit-learn \ scipy \ seaborn \ matplotlib \ xgboost \ catboost \ lightgbm \ requests \ fpdf2 \ python-dotenv \ google-generativeai \ groq \ Pillow \ statsmodels \ shap # Copy all project files COPY . . # Load environment variables from .env ENV PYTHONUNBUFFERED=1 # Expose Flask port for Hugging Face Spaces EXPOSE 7860 # Create necessary directories and set permissions for Hugging Face (UID 1000) RUN mkdir -p /app/uploads /app/data /app/data/models && \ chmod -R 777 /app # Switch to non-root user for Hugging Face USER 1000 # Start bridge server CMD ["python", "bridge_server.py"]