Aniruddha7/QueryLens-Text2SQL_DocVQA-V2
0
1# ☁️ Dockerfile for Hugging Face Spaces — Cloud-Only (Lightweight)2# Image size: ~500MB (no Ollama, no local models)3# All LLM inference is handled by Groq API and HF Inference API via USE_HF_CLOUD=14FROM python:3.11-slim5 6# Prevent Python from writing pyc files and buffering stdout/stderr7ENV PYTHONDONTWRITEBYTECODE=18ENV PYTHONUNBUFFERED=19 10# Cloud mode: all LLM calls go to Groq / HF Inference — no local Ollama needed11ENV USE_HF_CLOUD=112 13# Install system dependencies (Tesseract for OCR fallback only)14RUN apt-get update && apt-get install -y \15 curl \16 zstd \17 tesseract-ocr \18 libtesseract-dev \19 gcc \20 libpq-dev \21 && rm -rf /var/lib/apt/lists/*22 23WORKDIR /app24 25# Install Python dependencies26COPY requirements.txt .27RUN pip install --no-cache-dir --upgrade pip && \28 pip install --no-cache-dir -r requirements.txt && \29 pip install --no-cache-dir llama-index-llms-huggingface-api huggingface_hub30 31# Copy application code32COPY . .33 34# Hugging Face Spaces requires port 786035EXPOSE 786036 37# Fix line endings and permissions on startup script38RUN sed -i 's/\r$//' start_hf.sh && chmod +x start_hf.sh39 40CMD ["./start_hf.sh"]