ZeroTraceX commited on
Commit
d8763b8
·
verified ·
1 Parent(s): 1b23642

Update Dockerfile

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