forked from ybur-yug/python_ocr_tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (58 loc) · 1.79 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# start with a base image
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Madrid
# install dependencies
RUN sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y autoconf automake libtool
RUN apt-get install -y libpng-dev
RUN apt-get install -y libjpeg62-dev
RUN apt-get install -y g++
RUN apt-get install -y libtiff5-dev
RUN apt-get install -y libopencv-dev libtesseract-dev
RUN apt-get install -y git
RUN apt-get install -y cmake
RUN apt-get install -y build-essential
RUN apt-get install -y libleptonica-dev
RUN apt-get install -y liblog4cplus-dev
RUN apt-get install -y libcurl3-dev
RUN apt-get install -y python2.7-dev
RUN apt-get install -y tk8.5 tcl8.5 tk8.5-dev tcl8.5-dev
RUN apt-get install -y python-pil
RUN apt-get install -y imagemagick
RUN apt-get install -y wget
RUN apt-get install -y python python-pip
# build leptonica
RUN wget http://www.leptonica.org/source/leptonica-1.71.tar.gz
RUN tar -zxvf leptonica-1.71.tar.gz
WORKDIR leptonica-1.71/
RUN ./autobuild
RUN ./configure
RUN make
RUN make install
RUN ldconfig
WORKDIR /
RUN ls
# build tesseract
#RUN wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
#RUN tar -zxvf tesseract-ocr-3.02.02.tar.gz
#WORKDIR tesseract-ocr/
#RUN ./autogen.sh
#RUN ./configure
#RUN make
#RUN make install
#RUN ldconfig
#RUN cd ..
# download the relevant Tesseract English Language Packages
#RUN wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
#RUN tar -xf tesseract-ocr-3.02.eng.tar.gz
#RUN sudo cp -r tesseract-ocr/tessdata /usr/local/share/
RUN apt-get install -y tesseract-ocr
ADD requirements.txt /
RUN pip install -r requirements.txt
# update working directories
ADD ./flask_server /flask_server
WORKDIR /flask_server
EXPOSE 5000
CMD ["python", "app.py"]