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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -1,21 +1,28 @@
1
- FROM python:3.9
 
2
 
3
- # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  tesseract-ocr \
6
  libtesseract-dev \
7
  libleptonica-dev \
 
8
  poppler-utils \
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Set work directory
12
  WORKDIR /app
13
 
14
- # Copy code
15
  COPY . /app
16
 
17
  # Install Python dependencies
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # Run the app
 
 
 
21
  CMD ["python", "app.py"]
 
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"]