RajanMalaviya commited on
Commit
80b8f0c
·
verified ·
1 Parent(s): 49b2109

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -16
Dockerfile CHANGED
@@ -4,7 +4,6 @@ FROM python:3.10-slim
4
  RUN apt-get update && apt-get install -y \
5
  tesseract-ocr \
6
  tesseract-ocr-eng \
7
- tesseract-ocr-ara \
8
  poppler-utils \
9
  libopencv-dev \
10
  && apt-get clean \
@@ -13,27 +12,15 @@ RUN apt-get update && apt-get install -y \
13
  # Set Tesseract path
14
  ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata/
15
 
16
- # Create a non-root user and set up cache directory
17
- RUN useradd -m appuser && \
18
- mkdir -p /app/cache && \
19
- chown -R appuser:appuser /app
20
-
21
- # Set working directory
22
  WORKDIR /app
23
-
24
- # Copy requirements and install
25
  COPY requirements.txt .
26
  RUN pip install --no-cache-dir -r requirements.txt
27
-
28
- # Copy application code
29
  COPY app.py .
30
-
31
- # Switch to non-root user
32
  USER appuser
33
 
34
- # Set Hugging Face cache directory
35
- ENV HF_HOME=/app/cache
36
-
37
  # Expose port for FastAPI
38
  EXPOSE 7860
39
 
 
4
  RUN apt-get update && apt-get install -y \
5
  tesseract-ocr \
6
  tesseract-ocr-eng \
 
7
  poppler-utils \
8
  libopencv-dev \
9
  && apt-get clean \
 
12
  # Set Tesseract path
13
  ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata/
14
 
15
+ # Create a non-root user
16
+ RUN useradd -m appuser
 
 
 
 
17
  WORKDIR /app
 
 
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
 
 
20
  COPY app.py .
21
+ RUN chown -R appuser:appuser /app
 
22
  USER appuser
23
 
 
 
 
24
  # Expose port for FastAPI
25
  EXPOSE 7860
26