Tudu-Dev commited on
Commit
a8fa967
·
verified ·
1 Parent(s): 2520cde

Docker File Created

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies for OpenCV & EasyOCR
6
+ RUN apt-get update && apt-get install -y \
7
+ libgl1-mesa-glx \
8
+ libglib2.0-0 \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Install Python packages
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Download the OCR model now (so it doesn't download on every request)
16
+ RUN python -c "import easyocr; easyocr.Reader(['en'], gpu=False)"
17
+
18
+ COPY . .
19
+
20
+ # Start the API with permission for external access
21
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]