damoojeje commited on
Commit
be51358
·
verified ·
1 Parent(s): 57fff59

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -11
Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
- # Use a base image with Python and system utilities
2
  FROM python:3.10-slim
3
 
4
- # Install system packages including Tesseract
5
  RUN apt-get update && apt-get install -y \
6
  tesseract-ocr \
7
  libglib2.0-0 \
@@ -11,26 +11,30 @@ RUN apt-get update && apt-get install -y \
11
  libxrender-dev \
12
  poppler-utils \
13
  ffmpeg \
14
- build-essential \
15
  git \
 
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # 🔧 Make sure Tesseract is in PATH
19
- ENV TESSERACT_PATH=/usr/bin/tesseract
20
- ENV PATH="${TESSERACT_PATH}:${PATH}"
 
21
 
22
- # Work directory
23
  WORKDIR /home/user/app
24
 
25
- # Python packages
26
  COPY requirements.txt .
27
  RUN pip install --upgrade pip && pip install -r requirements.txt
28
 
29
- # Copy app files
30
  COPY . .
31
 
32
- # Download NLTK tokenizer data
33
  RUN python -m nltk.downloader punkt
34
 
35
- # Run the app
 
 
 
36
  CMD ["python", "app.py"]
 
1
+ # Use slim Python base image
2
  FROM python:3.10-slim
3
 
4
+ # Install system-level dependencies
5
  RUN apt-get update && apt-get install -y \
6
  tesseract-ocr \
7
  libglib2.0-0 \
 
11
  libxrender-dev \
12
  poppler-utils \
13
  ffmpeg \
 
14
  git \
15
+ build-essential \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Set environment variables
19
+ ENV PYTHONUNBUFFERED=1
20
+ ENV PIP_NO_CACHE_DIR=1
21
+ ENV HF_HUB_DISABLE_SYMLINKS_WARNING=1
22
 
23
+ # Set working directory
24
  WORKDIR /home/user/app
25
 
26
+ # Copy dependencies and install
27
  COPY requirements.txt .
28
  RUN pip install --upgrade pip && pip install -r requirements.txt
29
 
30
+ # Copy app source files
31
  COPY . .
32
 
33
+ # Download NLTK data (punkt tokenizer)
34
  RUN python -m nltk.downloader punkt
35
 
36
+ # Expose Gradio's default port
37
+ EXPOSE 7860
38
+
39
+ # Launch the Gradio app
40
  CMD ["python", "app.py"]