zhlajiex commited on
Commit
4fb53cf
·
1 Parent(s): e96b418

Fix: Explicitly set TESSDATA_PREFIX to resolve Tesseract language loading issue

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -3
Dockerfile CHANGED
@@ -15,7 +15,10 @@ RUN apt-get update && apt-get install -y \
15
  libxrender-dev \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Set up Python Virtual Environment (to avoid PEP 668 errors)
 
 
 
19
  ENV VIRTUAL_ENV=/opt/venv
20
  RUN python3 -m venv $VIRTUAL_ENV
21
  ENV PATH="$VIRTUAL_ENV/bin:$PATH"
@@ -26,7 +29,7 @@ RUN pip install --no-cache-dir paddlepaddle paddleocr pillow pillow-heif
26
  # Set working directory
27
  WORKDIR /app
28
 
29
- # Copy all your files
30
  COPY . .
31
 
32
  # Install Backend dependencies
@@ -39,4 +42,4 @@ RUN cd frontend && npm install && npm run build
39
  EXPOSE 7860
40
 
41
  # Start the application
42
- CMD ["node", "backend/server.js"]
 
15
  libxrender-dev \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Set Tesseract Data Prefix to fix "Error opening data file"
19
+ ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata/
20
+
21
+ # Set up Python Virtual Environment
22
  ENV VIRTUAL_ENV=/opt/venv
23
  RUN python3 -m venv $VIRTUAL_ENV
24
  ENV PATH="$VIRTUAL_ENV/bin:$PATH"
 
29
  # Set working directory
30
  WORKDIR /app
31
 
32
+ # Copy all files
33
  COPY . .
34
 
35
  # Install Backend dependencies
 
42
  EXPOSE 7860
43
 
44
  # Start the application
45
+ CMD ["node", "backend/server.js"]