sikeaditya commited on
Commit
9b367b6
·
verified ·
1 Parent(s): 471bcfd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # requirements.txt
2
+ flask==2.0.1
3
+ Werkzeug==2.0.1
4
+ PyPDF2==3.0.1
5
+ Pillow==9.5.0
6
+ python-markdown==3.4.3
7
+ google-generativeai==0.3.0
8
+ pytesseract==0.3.10
9
+ gunicorn==20.1.0
10
+
11
+ # Dockerfile
12
+ FROM python:3.9-slim
13
+
14
+ # Install system dependencies
15
+ RUN apt-get update && apt-get install -y \
16
+ tesseract-ocr \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Set working directory
20
+ WORKDIR /app
21
+
22
+ # Copy requirements and install dependencies
23
+ COPY requirements.txt .
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Copy application files
27
+ COPY app.py .
28
+ COPY templates/index.html templates/
29
+ COPY uploads uploads/
30
+
31
+ # Create uploads directory if it doesn't exist
32
+ RUN mkdir -p uploads
33
+
34
+ # Set environment variables
35
+ ENV PYTHONUNBUFFERED=1
36
+ ENV PORT=7860
37
+
38
+ # Expose port
39
+ EXPOSE 7860
40
+
41
+ # Command to run the application
42
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]