HunzalaRasheed1 commited on
Commit
47d7a53
·
verified ·
1 Parent(s): b7daa73

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ tesseract-ocr \
9
+ tesseract-ocr-eng \
10
+ poppler-utils \
11
+ libgl1-mesa-glx \
12
+ libglib2.0-0 \
13
+ libsm6 \
14
+ libxext6 \
15
+ libxrender-dev \
16
+ libgomp1 \
17
+ libglib2.0-0 \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # Copy requirements first for better caching
21
+ COPY requirements.txt .
22
+
23
+ # Install Python dependencies
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Copy application code
27
+ COPY . .
28
+
29
+ # Create uploads directory
30
+ RUN mkdir -p uploads
31
+
32
+ # Expose port
33
+ EXPOSE 7860
34
+
35
+ # Set environment variables for Hugging Face Spaces
36
+ ENV PYTHONUNBUFFERED=1
37
+ ENV FLASK_APP=app.py
38
+
39
+ # Run the application
40
+ CMD ["python", "app.py"]