File size: 1,048 Bytes
416649b
 
 
 
 
 
 
 
 
d76e78e
416649b
 
d76e78e
 
 
 
 
 
 
 
416649b
 
 
 
 
 
 
 
 
 
 
 
 
d76e78e
416649b
 
d76e78e
ab1013d
416649b
 
ab1013d
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
37
38
39
40
41
FROM python:3.10-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    tesseract-ocr \
    tesseract-ocr-eng tesseract-ocr-hin tesseract-ocr-ara tesseract-ocr-spa \
    tesseract-ocr-ita tesseract-ocr-fra tesseract-ocr-rus \
    poppler-utils \
    libopencv-dev \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Set environment variables to avoid permission issues
ENV XDG_CACHE_HOME=/tmp
ENV FONTCONFIG_PATH=/tmp

# Create temporary directories
RUN mkdir -p /tmp/fontconfig

# Set working directory
WORKDIR /app

# Copy files
COPY . /app/

# Debug: List files
RUN ls -la /app

# Verify files
RUN if [ ! -f /app/requirements.txt ]; then echo "requirements.txt not found" && exit 1; fi
RUN if [ ! -f /app/app.py ]; then echo "app.py not found" && exit 1; fi

# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r /app/requirements.txt

# Expose Hugging Face Spaces default port
EXPOSE 7860

# Run the app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]