CoolFace
Apppublic

BytecodeApps/docverse-api

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes
Dockerfile41 linesDownload Raw Back to root
1# Build image for DocVerse FastAPI Backend on Hugging Face Spaces2FROM python:3.10-slim3 4# Set environment variables5ENV PYTHONDONTWRITEBYTECODE=16ENV PYTHONUNBUFFERED=17 8# Install system dependencies (For EasyOCR & SciSpacy)9RUN apt-get update && apt-get install -y \10    build-essential \11    libpq-dev \12    gcc \13    tesseract-ocr \14    libtesseract-dev \15    && rm -rf /var/lib/apt/lists/*16 17# Hugging Face Spaces require running as a non-root user18RUN useradd -m -u 1000 user19USER user20ENV PATH="/home/user/.local/bin:$PATH"21 22# Set working directory23WORKDIR /app24 25# Install Python dependencies26COPY --chown=user requirements.txt /app/27RUN pip install --upgrade pip28RUN pip install --no-cache-dir -r requirements.txt29 30# Download SciSpacy models (Example: en_core_sci_sm for biomedical lit)31# RUN pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.1/en_core_sci_sm-0.5.1.tar.gz32 33# Copy application code with correct ownership34COPY --chown=user ./app /app/app35 36# Expose Hugging Face's required port37EXPOSE 786038 39# Start FastAPI application on port 786040CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]41