gaunernst commited on
Commit
2db0c5f
·
1 Parent(s): 254fb1c

copy app.py to docker and fix opencv

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -1
Dockerfile CHANGED
@@ -6,12 +6,22 @@ RUN apt-get update \
6
  && apt-get install -y tesseract-ocr \
7
  && rm -rf /var/lib/apt/lists/*
8
 
 
9
  RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
10
  && dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
11
  && rm libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
12
 
13
  RUN pip install torch==2.1.1 -i https://download.pytorch.org/whl/cpu
14
  RUN pip install paddlepaddle==2.5.1 -i https://mirror.baidu.com/pypi/simple
15
- RUN pip install transformers pytesseract paddleocr gradio Pillow
 
 
 
 
 
 
 
 
 
16
 
17
  CMD ["python", "app.py"]
 
6
  && apt-get install -y tesseract-ocr \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # libssl1.1 for PaddlePaddle
10
  RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
11
  && dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb \
12
  && rm libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
13
 
14
  RUN pip install torch==2.1.1 -i https://download.pytorch.org/whl/cpu
15
  RUN pip install paddlepaddle==2.5.1 -i https://mirror.baidu.com/pypi/simple
16
+ RUN pip install transformers pytesseract gradio Pillow
17
+ RUN pip install paddleocr==2.7.0.3 \
18
+ && pip uninstall -y opencv-python opencv-contrib-python \
19
+ && pip install opencv-python-headless
20
+
21
+ RUN useradd -m -u 1000 user
22
+ USER user
23
+ ENV HOME=/home/user
24
+ WORKDIR $HOME/app
25
+ COPY --chown=user . $HOME/app
26
 
27
  CMD ["python", "app.py"]