ZeroTraceX commited on
Commit
90a3d0b
·
verified ·
1 Parent(s): 7576293

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -8
Dockerfile CHANGED
@@ -1,13 +1,32 @@
1
- FROM python:3.9
2
 
3
- RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
 
 
 
 
 
6
 
 
 
 
 
7
  WORKDIR /app
8
 
9
- COPY --chown=user ./requirements.txt requirements.txt
10
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
 
 
 
11
 
12
- COPY --chown=user . /app
13
- CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
 
1
+ FROM python:3.9-slim
2
 
3
+ # Install system dependencies including poppler-utils and tesseract
4
+ RUN apt-get update && apt-get install -y \
5
+ poppler-utils \
6
+ tesseract-ocr \
7
+ tesseract-ocr-eng \
8
+ libgl1-mesa-glx \
9
+ libglib2.0-0 \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Set environment variable for Tesseract
13
+ ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata
14
+
15
+ # Create app directory
16
  WORKDIR /app
17
 
18
+ # Install Python dependencies
19
+ COPY requirements.txt .
20
+ RUN pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Copy application code
23
+ COPY . .
24
+
25
+ # Create uploads directory with proper permissions
26
+ RUN mkdir -p uploads && chmod 777 uploads
27
+
28
+ # Expose the port
29
+ EXPOSE 8080
30
 
31
+ # Run the application with gunicorn
32
+ CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]