vasdevaman6 commited on
Commit
2bc9380
·
verified ·
1 Parent(s): 7bfc7e5

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +10 -1
  2. requirements.txt +6 -6
Dockerfile CHANGED
@@ -4,12 +4,13 @@ FROM python:3.10-slim
4
  # Ensure Python output is unbuffered
5
  ENV PYTHONUNBUFFERED=1
6
 
7
- # 2. Install system dependencies for EasyOCR & OpenCV
8
  RUN apt-get update && \
9
  apt-get install -y --no-install-recommends \
10
  libgl1 \
11
  libgomp1 \
12
  libsm6 libxext6 libxrender1 \
 
13
  && apt-get clean && rm -rf /var/lib/apt/lists/*
14
 
15
  # 3. Set working directory
@@ -26,9 +27,17 @@ RUN mkdir -p /app/uploads && chmod -R 777 /app/uploads
26
  RUN mkdir -p /.EasyOCR && chmod -R 777 /.EasyOCR
27
  RUN mkdir -p /app/easyocr_models && chmod -R 777 /app/easyocr_models
28
 
 
 
 
29
  # 7. Copy all project files
30
  COPY . .
31
 
 
 
 
 
 
32
  # 8. Environment variables
33
  ENV PORT=7860
34
 
 
4
  # Ensure Python output is unbuffered
5
  ENV PYTHONUNBUFFERED=1
6
 
7
+ # 2. Install system dependencies for EasyOCR, OpenCV, and OCR
8
  RUN apt-get update && \
9
  apt-get install -y --no-install-recommends \
10
  libgl1 \
11
  libgomp1 \
12
  libsm6 libxext6 libxrender1 \
13
+ tesseract-ocr \
14
  && apt-get clean && rm -rf /var/lib/apt/lists/*
15
 
16
  # 3. Set working directory
 
27
  RUN mkdir -p /.EasyOCR && chmod -R 777 /.EasyOCR
28
  RUN mkdir -p /app/easyocr_models && chmod -R 777 /app/easyocr_models
29
 
30
+ # 🔧 NEW: Ensure all model and script files are readable
31
+ RUN chmod -R 755 /app
32
+
33
  # 7. Copy all project files
34
  COPY . .
35
 
36
+ # 🔧 NEW: Ensure models exist and have permissions
37
+ RUN chmod 644 /app/cnn_model.h5 || true
38
+ RUN chmod 644 /app/model.pkl || true
39
+ RUN chmod -R 755 /app/*.py || true
40
+
41
  # 8. Environment variables
42
  ENV PORT=7860
43
 
requirements.txt CHANGED
@@ -1,10 +1,10 @@
1
  Flask
2
- gunicorn # Production web server needed for deployment
3
  numpy
4
  pandas
5
  scikit-learn
6
- tensorflow # Core ML library for Keras and Grad-CAM
7
- keras # Keras API for building/running models
8
- easyocr # For the OCR functionality
9
- opencv-python-headless # Essential dependency for image processing (cv2)
10
- pillow # For PIL image handling
 
1
  Flask
2
+ gunicorn # Production WSGI server for Flask
3
  numpy
4
  pandas
5
  scikit-learn
6
+ tensorflow==2.13.0 # Stable TensorFlow version for Python 3.10
7
+ keras==2.13.1 # Match TensorFlow version (important for compatibility)
8
+ easyocr
9
+ opencv-python-headless==4.8.1.78 # Headless version for servers
10
+ pillow