admin08077 commited on
Commit
3cde666
·
verified ·
1 Parent(s): a7db57c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -8
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
- # Start from an official Python image
2
- FROM python:3.9-slim
3
 
4
- # Install system packages (tesseract-ocr, ffmpeg for audio, poppler-utils for PDF if you want advanced PDF to images)
5
  RUN apt-get update && apt-get install -y \
6
  tesseract-ocr \
7
  libtesseract-dev \
@@ -10,20 +10,30 @@ RUN apt-get update && apt-get install -y \
10
  libxext6 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
 
 
 
 
 
 
13
  # Create a working directory
14
  WORKDIR /app
15
 
16
- # Copy requirements
17
  COPY requirements.txt .
18
 
19
- # Install python dependencies
 
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # Copy your app code
 
 
 
23
  COPY app.py .
24
 
25
- # Expose Gradio's default port
26
  EXPOSE 7860
27
 
28
- # Run the app
29
  CMD ["python", "app.py"]
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
 
4
+ # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
6
  tesseract-ocr \
7
  libtesseract-dev \
 
10
  libxext6 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Install Poppler-utils for advanced PDF processing (optional)
14
+ RUN apt-get update && apt-get install -y poppler-utils && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Set environment variables
17
+ ENV LANG C.UTF-8
18
+
19
  # Create a working directory
20
  WORKDIR /app
21
 
22
+ # Copy the requirements file
23
  COPY requirements.txt .
24
 
25
+ # Upgrade pip and install Python dependencies
26
+ RUN pip install --upgrade pip
27
  RUN pip install --no-cache-dir -r requirements.txt
28
 
29
+ # Download NLTK data
30
+ RUN python -m nltk.downloader punkt
31
+
32
+ # Copy the application code
33
  COPY app.py .
34
 
35
+ # Expose the port Gradio runs on
36
  EXPOSE 7860
37
 
38
+ # Define the default command to run the app
39
  CMD ["python", "app.py"]