Spaces:
Build error
Build error
File size: 814 Bytes
9df6af9 7e04d95 9df6af9 7e04d95 9df6af9 7e04d95 9df6af9 7e04d95 9df6af9 7e04d95 9df6af9 7e04d95 9df6af9 7e04d95 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | FROM python:3.11-slim
# Install system dependencies including Tesseract OCR
RUN apt-get update && apt-get install -y \
tesseract-ocr \
tesseract-ocr-spa \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Set up user (required by HuggingFace Spaces)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Copy requirements and install dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY --chown=user app.py .
# Expose port for Gradio
EXPOSE 7860
# Set environment variables
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
# Run the application
CMD ["python", "app.py"]
|