File size: 751 Bytes
2f0cc7d
 
14243c9
6a0670c
14243c9
 
2f0cc7d
 
 
 
 
6a0670c
2f0cc7d
 
 
6a0670c
 
2f0cc7d
 
 
bfd5ff2
6a0670c
14243c9
 
2f0cc7d
6a0670c
 
2f0cc7d
 
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
# Use optimized Python image
FROM python:3.9-slim

# Set the working directory inside the container
WORKDIR /app

# Install required system dependencies for OCR & PDFs
RUN apt-get update && apt-get install -y \
    tesseract-ocr \
    poppler-utils \
    && rm -rf /var/lib/apt/lists/*

# Set environment variables for Hugging Face cache
ENV HF_HOME=/tmp/cache
RUN mkdir -p /tmp/cache && chmod 777 /tmp/cache

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

# Copy the application code
COPY . .

# Expose the port for API access
EXPOSE 7860

# Use Gunicorn for production
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]