Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -9
Dockerfile
CHANGED
@@ -1,28 +1,34 @@
|
|
1 |
-
# Use a
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
-
#
|
|
|
|
|
|
|
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 |
-
#
|
|
|
|
|
|
|
16 |
WORKDIR /app
|
17 |
|
18 |
-
# Copy
|
19 |
-
COPY .
|
20 |
|
21 |
# Install Python dependencies
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
|
24 |
-
#
|
25 |
-
|
26 |
|
27 |
-
#
|
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"]
|