redhairedshanks1 commited on
Commit
e104ff7
·
verified ·
1 Parent(s): 4911653

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -26
Dockerfile CHANGED
@@ -8,44 +8,33 @@ ENV PADDLEOCR_HOME=/app/.paddleocr
8
 
9
  WORKDIR /app
10
 
11
- # Create writable OCR model directory and change ownership
12
  RUN mkdir -p /app/.paddleocr && \
13
  adduser --disabled-password --gecos '' appuser && \
14
  chown -R appuser:appuser /app
15
 
16
- # Update package list and install system-level dependencies
17
- RUN apt-get update && \
18
- apt-get install -y --no-install-recommends \
19
- poppler-utils \
20
- libgl1-mesa-glx \
21
- libglib2.0-0 \
22
- libsm6 \
23
- libxext6 \
24
- libxrender-dev \
25
- libgl1 \
26
- libglib2.0-dev \
27
- libcairo2 \
28
- libpango1.0-0 \
29
- libpangocairo-1.0-0 \
30
- libgdk-pixbuf2.0-0 \
31
- python3-tk \
32
- ghostscript \
33
- libgomp1 && \
34
- apt-get clean && \
35
- rm -rf /var/lib/apt/lists/*
36
 
37
  # Install Python dependencies
38
  COPY requirements.txt .
39
- RUN pip install --upgrade pip && \
40
- pip install --no-cache-dir -r requirements.txt
41
 
42
- # Copy your code
43
  COPY . .
44
 
45
- # Switch to non-root user (required by Hugging Face Spaces)
46
  USER appuser
47
 
48
- # Expose port (adjust based on what you're running)
49
  EXPOSE 7860
50
 
51
  # Start the app
 
8
 
9
  WORKDIR /app
10
 
11
+ # Create writable OCR model directory and non-root user
12
  RUN mkdir -p /app/.paddleocr && \
13
  adduser --disabled-password --gecos '' appuser && \
14
  chown -R appuser:appuser /app
15
 
16
+ # Install system dependencies (only what's actually needed)
17
+ RUN apt-get update && apt-get install -y --no-install-recommends \
18
+ libgl1-mesa-glx \
19
+ libglib2.0-0 \
20
+ libsm6 \
21
+ libxext6 \
22
+ libxrender-dev \
23
+ libgomp1 \
24
+ poppler-utils \
25
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
26
 
27
  # Install Python dependencies
28
  COPY requirements.txt .
29
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
 
30
 
31
+ # Copy project files
32
  COPY . .
33
 
34
+ # Switch to non-root user
35
  USER appuser
36
 
37
+ # Expose FastAPI port
38
  EXPOSE 7860
39
 
40
  # Start the app