# DecipherAI Backend — Hugging Face Spaces Docker Configuration # Space SDK: Docker # Port: 7860 FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ tesseract-ocr \ wget \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Download Ancient Greek Tesseract model RUN mkdir -p /usr/share/tesseract-ocr/5/tessdata && \ wget -q \ https://github.com/tesseract-ocr/tessdata/raw/main/grc.traineddata \ -O /usr/share/tesseract-ocr/5/tessdata/grc.traineddata # Create non-root user (HF Spaces recommendation) RUN useradd -m -u 1000 user USER user ENV HOME=/home/user ENV PATH=/home/user/.local/bin:$PATH WORKDIR /home/user/app # Install Python dependencies COPY --chown=user:user requirements.txt . RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy application COPY --chown=user:user . . # Hugging Face Space port EXPOSE 7860 # Production server CMD ["gunicorn", \ "--bind", "0.0.0.0:7860", \ "--workers", "1", \ "--timeout", "300", \ "--preload", \ "app:app"]