triflix commited on
Commit
87014b3
·
verified ·
1 Parent(s): a09fca3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -3
Dockerfile CHANGED
@@ -1,19 +1,38 @@
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies (poppler for PDFs + OpenGL for OpenCV)
6
  RUN apt-get update && apt-get install -y \
7
  libgomp1 \
8
  libglib2.0-0 \
 
 
 
 
9
  poppler-utils \
10
- libgl1-mesa-glx \
11
  && rm -rf /var/lib/apt/lists/*
12
 
 
13
  COPY requirements.txt .
14
- RUN pip install --no-cache-dir -r requirements.txt
15
 
 
 
 
 
 
 
 
16
  COPY app.py .
17
 
 
18
  EXPOSE 7860
 
 
 
 
 
 
 
19
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Set working directory
4
  WORKDIR /app
5
 
6
+ # Install system dependencies for PaddleOCR and pdf2image
7
  RUN apt-get update && apt-get install -y \
8
  libgomp1 \
9
  libglib2.0-0 \
10
+ libsm6 \
11
+ libxext6 \
12
+ libxrender-dev \
13
+ libgl1-mesa-glx \
14
  poppler-utils \
 
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Copy requirements
18
  COPY requirements.txt .
 
19
 
20
+ # Install Python dependencies
21
+ RUN pip install --no-cache-dir --upgrade pip && \
22
+ pip install --no-cache-dir paddlepaddle==3.0.0 && \
23
+ python -m pip install --no-cache-dir paddleocr && \
24
+ pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Copy application
27
  COPY app.py .
28
 
29
+ # Expose port (HuggingFace Spaces uses 7860)
30
  EXPOSE 7860
31
+
32
+ # Set environment variables
33
+ ENV PYTHONUNBUFFERED=1
34
+ ENV GRADIO_SERVER_NAME=0.0.0.0
35
+ ENV GRADIO_SERVER_PORT=7860
36
+
37
+ # Run the application
38
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]