yeswanthvarma commited on
Commit
a4b473b
·
verified ·
1 Parent(s): ff71bc6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -2
Dockerfile CHANGED
@@ -1,22 +1,28 @@
1
- # Inside your Dockerfile
2
  FROM python:3.10-slim
3
 
 
4
  ENV HF_HOME=/tmp/huggingface
5
  ENV TORCH_HOME=/tmp/torch
6
- ENV EASYOCR_HOME=/tmp/.easyocr
 
7
 
 
8
  RUN apt-get update && apt-get install -y \
9
  libgl1 \
10
  libglib2.0-0 \
11
  && rm -rf /var/lib/apt/lists/*
12
 
 
13
  RUN mkdir -p /tmp/.easyocr && chmod -R 777 /tmp/.easyocr
14
 
 
15
  WORKDIR /app
16
  COPY . .
17
 
 
18
  RUN pip install --no-cache-dir --upgrade pip
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
  EXPOSE 7860
 
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # ✅ Set all required environment variables
4
  ENV HF_HOME=/tmp/huggingface
5
  ENV TORCH_HOME=/tmp/torch
6
+ ENV EASYOCR_HOME=/tmp/.easyocr
7
+ ENV HOME=/tmp # ✅ This prevents EasyOCR from using '/.EasyOCR'
8
 
9
+ # ✅ System dependencies for OpenCV and EasyOCR
10
  RUN apt-get update && apt-get install -y \
11
  libgl1 \
12
  libglib2.0-0 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # ✅ Pre-create the EasyOCR directory
16
  RUN mkdir -p /tmp/.easyocr && chmod -R 777 /tmp/.easyocr
17
 
18
+ # Set working directory
19
  WORKDIR /app
20
  COPY . .
21
 
22
+ # Install dependencies
23
  RUN pip install --no-cache-dir --upgrade pip
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
  EXPOSE 7860
27
+
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]