RajanMalaviya commited on
Commit
baf575c
·
verified ·
1 Parent(s): 7334b9a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -23
Dockerfile CHANGED
@@ -1,28 +1,11 @@
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 \
7
- poppler-utils \
8
- libopencv-dev \
9
- && apt-get clean \
10
- && rm -rf /var/lib/apt/lists/*
11
 
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
 
27
- # Command to run the app
28
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.9
2
 
3
+ WORKDIR /code
 
 
 
 
 
 
 
4
 
5
+ COPY ./requirements.txt /code/requirements.txt
 
6
 
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
 
 
 
 
 
8
 
9
+ COPY ./main.py /code/
 
10
 
11
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]