gopichandra commited on
Commit
daeb81c
·
verified ·
1 Parent(s): 4604187

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -1,28 +1,34 @@
1
- # Use a Python base image
2
  FROM python:3.9-slim
3
 
4
- # Install system packages required for Tesseract OCR and Pillow image handling
 
 
 
5
  RUN apt-get update && apt-get install -y \
6
  tesseract-ocr \
7
  libtesseract-dev \
8
  libleptonica-dev \
9
- pkg-config \
10
  poppler-utils \
 
11
  build-essential \
12
  python3-dev \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Set the working directory
 
 
 
16
  WORKDIR /app
17
 
18
- # Copy all project files into the container
19
- COPY . /app
20
 
21
  # Install Python dependencies
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
- # Expose default port for Gradio (optional for local)
25
- EXPOSE 7860
26
 
27
- # Run the Gradio app
28
  CMD ["python", "app.py"]
 
1
+ # Use a full Debian-based image with Python
2
  FROM python:3.9-slim
3
 
4
+ # Set environment variables for non-interactive installs
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install Tesseract and required system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  tesseract-ocr \
10
  libtesseract-dev \
11
  libleptonica-dev \
 
12
  poppler-utils \
13
+ pkg-config \
14
  build-essential \
15
  python3-dev \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # (Optional) Add Hindi or other Tesseract language packs if needed:
19
+ # RUN apt-get install -y tesseract-ocr-hin tesseract-ocr-eng
20
+
21
+ # Set working directory
22
  WORKDIR /app
23
 
24
+ # Copy project files
25
+ COPY . .
26
 
27
  # Install Python dependencies
28
  RUN pip install --no-cache-dir -r requirements.txt
29
 
30
+ # Set environment PATH explicitly in case PATH issues exist
31
+ ENV PATH="/usr/bin/tesseract:${PATH}"
32
 
33
+ # Default command to run the Gradio app
34
  CMD ["python", "app.py"]