KZTech commited on
Commit
6c6aad2
·
verified ·
1 Parent(s): 723f9b2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -6
Dockerfile CHANGED
@@ -1,12 +1,29 @@
1
- # Use Hugging Face’s OCR base image (includes Tesseract)
2
- FROM ghcr.io/huggingface/spaces-sdk:ocr
3
 
4
- # Copy dependencies and install
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
- RUN pip install -r requirements.txt
7
 
8
- # Copy app code
9
  COPY app.py .
10
 
11
- # Launch the Streamlit app
 
 
 
12
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
 
4
+ # Set environment variables
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install Tesseract OCR and its dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ tesseract-ocr \
10
+ libtesseract-dev \
11
+ libleptonica-dev \
12
+ pkg-config \
13
+ poppler-utils \
14
+ && apt-get clean \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Install Python dependencies
18
  COPY requirements.txt .
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Copy the application code
22
  COPY app.py .
23
 
24
+ # Expose the port Streamlit will run on
25
+ EXPOSE 7860
26
+
27
+ # Command to run the application
28
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
29
+