shubhjo commited on
Commit
416649b
·
verified ·
1 Parent(s): 504abbc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -43
Dockerfile CHANGED
@@ -1,43 +1,37 @@
1
- FROM python:3.10-slim
2
-
3
- # Install system dependencies
4
-
5
- RUN apt-get update && apt-get install -y \
6
- tesseract-ocr \
7
- tesseract-ocr-eng tesseract-ocr-hin tesseract-ocr-ara tesseract-ocr-spa \
8
- tesseract-ocr-ita tesseract-ocr-fra tesseract-ocr-rus \
9
- poppler-utils \
10
- libopencv-dev \
11
- && rm -rf /var/lib/apt/lists/\*
12
-
13
- # Create working directory
14
-
15
- RUN mkdir -p /app WORKDIR /app
16
-
17
- # Copy files
18
-
19
- COPY . /app/
20
-
21
- # Debug: List files
22
-
23
- RUN ls -la /app
24
-
25
- # Verify files
26
-
27
- RUN if \[ ! -f /app/requirements.txt \]; then echo "requirements.txt not found" && exit 1; fi RUN if \[ ! -f /app/ocr_api.py \]; then echo "ocr_api.py not found" && exit 1; fi
28
-
29
- # Install Python dependencies
30
-
31
- RUN pip install --no-cache-dir -r /app/requirements.txt
32
-
33
- # Create non-root user
34
-
35
- RUN useradd -m appuser USER appuser
36
-
37
- # Expose port
38
-
39
- EXPOSE 8000
40
-
41
- # Run the app
42
-
43
- CMD \["uvicorn", "ocr_api:app", "--host", "0.0.0.0", "--port", "8000"\]
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ tesseract-ocr \
6
+ tesseract-ocr-eng tesseract-ocr-hin tesseract-ocr-ara tesseract-ocr-spa \
7
+ tesseract-ocr-ita tesseract-ocr-fra tesseract-ocr-rus \
8
+ poppler-utils \
9
+ libopencv-dev \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Create working directory
13
+ RUN mkdir -p /app
14
+ WORKDIR /app
15
+
16
+ # Copy files
17
+ COPY . /app/
18
+
19
+ # Debug: List files
20
+ RUN ls -la /app
21
+
22
+ # Verify files
23
+ RUN if [ ! -f /app/requirements.txt ]; then echo "requirements.txt not found" && exit 1; fi
24
+ RUN if [ ! -f /app/app.py ]; then echo "app.py not found" && exit 1; fi
25
+
26
+ # Install Python dependencies
27
+ RUN pip install --no-cache-dir -r /app/requirements.txt
28
+
29
+ # Create non-root user
30
+ RUN useradd -m appuser
31
+ USER appuser
32
+
33
+ # Expose port
34
+ EXPOSE 8000
35
+
36
+ # Run the app
37
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]