File size: 729 Bytes
be6eecc
6e8141b
 
be6eecc
 
 
 
 
 
6e8141b
992a78d
6e8141b
 
be6eecc
6e8141b
 
10eddf4
 
 
be6eecc
6e8141b
 
be6eecc
6e8141b
 
be6eecc
6e8141b
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
# Base image with FastAPI support
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9

# Install Tesseract OCR and required language packs
RUN apt-get update && apt-get install -y tesseract-ocr \
    tesseract-ocr-eng \
    tesseract-ocr-rus \
    tesseract-ocr-msa && \
    apt-get clean

# Set the working directory
WORKDIR /app

# Copy project files
COPY . /app

# Create directories with correct permissions
RUN mkdir -p /app/uploads /app/outputs && chmod -R 777 /app/uploads /app/outputs

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

# Expose the default port used by Hugging Face
EXPOSE 7860

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