MakPr016 commited on
Commit
7959a17
·
1 Parent(s): ed38d82

Updated Dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +14 -2
  2. requirements.txt +1 -1
Dockerfile CHANGED
@@ -17,15 +17,24 @@ RUN apt-get update && apt-get install -y \
17
  libxext6 \
18
  libxrender-dev \
19
  libgomp1 \
 
 
 
 
20
  git \
21
  git-lfs \
 
 
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
  COPY requirements.txt .
25
- RUN pip install --no-cache-dir -r requirements.txt
 
26
 
27
  RUN python -m spacy download en_core_web_sm
28
 
 
 
29
  COPY app/ ./app/
30
 
31
  RUN mkdir -p models/xray_ner_best && \
@@ -38,4 +47,7 @@ ENV PYTHONUNBUFFERED=1
38
 
39
  EXPOSE 7860
40
 
41
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
17
  libxext6 \
18
  libxrender-dev \
19
  libgomp1 \
20
+ poppler-utils \
21
+ tesseract-ocr \
22
+ tesseract-ocr-eng \
23
+ libmagic1 \
24
  git \
25
  git-lfs \
26
+ curl \
27
+ wget \
28
  && rm -rf /var/lib/apt/lists/*
29
 
30
  COPY requirements.txt .
31
+ RUN pip install --no-cache-dir --upgrade pip && \
32
+ pip install --no-cache-dir -r requirements.txt
33
 
34
  RUN python -m spacy download en_core_web_sm
35
 
36
+ RUN python -c "import easyocr; easyocr.Reader(['en'], gpu=False, download_enabled=True)"
37
+
38
  COPY app/ ./app/
39
 
40
  RUN mkdir -p models/xray_ner_best && \
 
47
 
48
  EXPOSE 7860
49
 
50
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=3 \
51
+ CMD curl -f http://localhost:7860/health || exit 1
52
+
53
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
requirements.txt CHANGED
@@ -19,6 +19,6 @@ PyNaCl==1.5.0
19
 
20
  # ==================================================================
21
  # INSTALLATION:
22
- # 1. pip install -r requirements-minimal.txt
23
  # 2. python -m spacy download en_core_web_sm
24
  # ==================================================================
 
19
 
20
  # ==================================================================
21
  # INSTALLATION:
22
+ # 1. pip install -r requirements.txt
23
  # 2. python -m spacy download en_core_web_sm
24
  # ==================================================================