File size: 794 Bytes
6f80fc8
 
df2d066
6f80fc8
df2d066
6f80fc8
 
df2d066
6f80fc8
 
df2d066
 
 
 
 
 
 
 
 
 
 
6f80fc8
 
 
 
df2d066
6f80fc8
 
df2d066
6f80fc8
 
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
FROM python:3.13.6-slim

# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    poppler-utils \
    tesseract-ocr \
    fonts-dejavu \
    && rm -rf /var/lib/apt/lists/*

# Create writable dirs
RUN mkdir -p /app/data && chmod -R 777 /app/data
RUN mkdir -p /tmp/matplotlib && chmod -R 777 /tmp/matplotlib
RUN mkdir -p /tmp/fontconfig && chmod -R 777 /tmp/fontconfig
RUN mkdir -p /app/output && chmod -R 777 /app/output   # ✅ for your PDFs/plots

# Environment vars for cache dirs
ENV MPLCONFIGDIR=/tmp/matplotlib
ENV XDG_CACHE_HOME=/tmp/fontconfig

# Hugging Face expects port 7860
ENV PORT=7860
EXPOSE 7860

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "app.py"]