File size: 753 Bytes
ed74fda
 
 
 
dd5d745
 
 
 
 
 
ed74fda
 
 
 
 
dd5d745
ed74fda
dd5d745
ed74fda
dd5d745
ed74fda
 
dd5d745
 
 
 
 
ed74fda
 
 
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
FROM python:3.11

WORKDIR /app

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

COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

# Create writable directories with proper permissions
RUN mkdir -p /app/data && chmod -R 777 /app/data
RUN mkdir -p /app/static && chmod -R 777 /app/static
RUN mkdir -p /app/uploads && chmod -R 777 /app/uploads
RUN mkdir -p /app/clip_cache && chmod -R 777 /app/clip_cache
RUN mkdir -p /app/logs && chmod -R 777 /app/logs

# Set environment variables for cache directories
ENV CLIP_CACHE=/app/clip_cache
ENV HF_HOME=/app/clip_cache
ENV TORCH_HOME=/app/clip_cache

EXPOSE 7860

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