redhairedshanks1 commited on
Commit
6758b3d
·
verified ·
1 Parent(s): 14da8ca

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -13
Dockerfile CHANGED
@@ -8,16 +8,15 @@ ENV PADDLEOCR_HOME=/app/.paddleocr
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
17
  RUN apt-get update && \
18
  apt-get install -y --no-install-recommends \
19
  poppler-utils \
20
- tesseract-ocr \
21
  libgl1-mesa-glx \
22
  libglib2.0-0 \
23
  libsm6 \
@@ -31,24 +30,23 @@ RUN apt-get update && \
31
  libgdk-pixbuf2.0-0 \
32
  python3-tk \
33
  ghostscript \
34
- libgomp1 \
35
- curl \
36
- && apt-get clean && \
37
  rm -rf /var/lib/apt/lists/*
38
 
39
- # Install Python packages
40
  COPY requirements.txt .
41
  RUN pip install --upgrade pip && \
42
  pip install --no-cache-dir -r requirements.txt
43
 
44
- # Copy application code
45
  COPY . .
46
 
47
- # Switch to non-root user
48
  USER appuser
49
 
50
- # Expose port 3001
51
- EXPOSE 3001
52
 
53
- # Start app
54
- CMD ["python", "app.py"]
 
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 \
 
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
52
+ CMD ["python", "app.py"]