sksameermujahid commited on
Commit
c3f6db5
·
verified ·
1 Parent(s): 3b59a13

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -11
Dockerfile CHANGED
@@ -1,27 +1,32 @@
1
  FROM python:3.10-slim
2
 
3
- WORKDIR /app
4
-
5
  # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- libgl1-mesa-glx \
9
- libglib2.0-0 \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
 
 
12
  # Copy requirements first to leverage Docker cache
13
  COPY requirements.txt .
 
 
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy the rest of the application
 
 
 
17
  COPY . .
18
 
 
 
 
19
  # Set environment variables
 
20
  ENV FLASK_APP=app.py
21
- ENV FLASK_ENV=production
22
-
23
- # Expose the port
24
- EXPOSE 7860
25
 
26
  # Run the application
27
- CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
 
 
3
  # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
+ tesseract-ocr \
6
+ tesseract-ocr-eng \
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # Set working directory
10
+ WORKDIR /app
11
+
12
  # Copy requirements first to leverage Docker cache
13
  COPY requirements.txt .
14
+
15
+ # Install Python dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Download spaCy model
19
+ RUN python -m spacy download en_core_web_sm
20
+
21
+ # Copy application code
22
  COPY . .
23
 
24
+ # Expose port
25
+ EXPOSE 7860
26
+
27
  # Set environment variables
28
+ ENV PYTHONUNBUFFERED=1
29
  ENV FLASK_APP=app.py
 
 
 
 
30
 
31
  # Run the application
32
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]