damoojeje commited on
Commit
32e9a12
·
verified ·
1 Parent(s): 2d58fdd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -9
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
- # Use slim Python base image
2
  FROM python:3.10-slim
3
 
4
  # Install system-level dependencies
@@ -13,28 +12,36 @@ RUN apt-get update && apt-get install -y \
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"]
 
 
1
  FROM python:3.10-slim
2
 
3
  # Install system-level dependencies
 
12
  ffmpeg \
13
  git \
14
  build-essential \
15
+ curl \
16
+ && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Environment variables
19
  ENV PYTHONUNBUFFERED=1
20
  ENV PIP_NO_CACHE_DIR=1
21
  ENV HF_HUB_DISABLE_SYMLINKS_WARNING=1
22
+ ENV LANG=C.UTF-8
23
+ ENV LC_ALL=C.UTF-8
24
+ ENV TESSERACT_PATH=/usr/bin/tesseract
25
+ ENV PATH="${TESSERACT_PATH}:${PATH}"
26
 
27
+ # Work directory
28
  WORKDIR /home/user/app
29
 
30
+ # Install Python dependencies
31
  COPY requirements.txt .
32
  RUN pip install --upgrade pip && pip install -r requirements.txt
33
 
34
+ # Copy application code
35
  COPY . .
36
 
37
+ # Download NLTK tokenizer
38
  RUN python -m nltk.downloader punkt
39
 
40
+ # Expose port for Gradio
41
  EXPOSE 7860
42
 
43
+ # Optional: container healthcheck
44
+ HEALTHCHECK CMD curl --fail http://localhost:7860 || exit 1
45
+
46
+ # Start app
47
  CMD ["python", "app.py"]