yeswanthvarma commited on
Commit
375a4a2
·
verified ·
1 Parent(s): 81a0a71

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -9
Dockerfile CHANGED
@@ -1,27 +1,23 @@
 
1
  FROM python:3.10-slim
 
2
  ENV HF_HOME=/tmp/huggingface
3
  ENV TORCH_HOME=/tmp/torch
4
- RUN mkdir -p /tmp/.easyocr && chmod -R 777 /tmp/.easyocr
5
 
6
- # System dependencies for OpenCV
7
  RUN apt-get update && apt-get install -y \
8
  libgl1 \
9
  libglib2.0-0 \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
 
12
 
13
- # Set working directory
14
  WORKDIR /app
15
-
16
- # Copy everything
17
  COPY . .
18
 
19
- # Install Python dependencies
20
  RUN pip install --no-cache-dir --upgrade pip
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # Expose port
24
  EXPOSE 7860
25
-
26
- # Start FastAPI app
27
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
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 # Required here as well
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
+ # ✅ Fix permission for EasyOCR before copying source
14
+ RUN mkdir -p /tmp/.easyocr && chmod -R 777 /tmp/.easyocr
15
 
 
16
  WORKDIR /app
 
 
17
  COPY . .
18
 
 
19
  RUN pip install --no-cache-dir --upgrade pip
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
 
22
  EXPOSE 7860
 
 
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]