1+ # start with a base image
2+ FROM ubuntu:14.04
3+
4+ # install dependencies
5+ RUN apt-get update
6+ RUN apt-get install -y autoconf automake libtool
7+ RUN apt-get install -y libpng12-dev
8+ RUN apt-get install -y libjpeg62-dev
9+ RUN apt-get install -y g++
10+ RUN apt-get install -y libtiff4-dev
11+ RUN apt-get install -y libopencv-dev libtesseract-dev
12+ RUN apt-get install -y git
13+ RUN apt-get install -y cmake
14+ RUN apt-get install -y build-essential
15+ RUN apt-get install -y libleptonica-dev
16+ RUN apt-get install -y liblog4cplus-dev
17+ RUN apt-get install -y libcurl3-dev
18+ RUN apt-get install -y python2.7-dev
19+ RUN apt-get install -y tk8.5 tcl8.5 tk8.5-dev tcl8.5-dev
20+ RUN apt-get build-dep -y python-imaging --fix-missing
21+ RUN apt-get install -y imagemagick
22+ RUN apt-get install -y wget
23+ RUN apt-get install -y python python-pip
24+
25+ # build leptonica
26+ RUN wget http://www.leptonica.org/source/leptonica-1.70.tar.gz
27+ RUN tar -zxvf leptonica-1.70.tar.gz
28+ WORKDIR leptonica-1.70/
29+ RUN ./autobuild
30+ RUN ./configure
31+ RUN make
32+ RUN make install
33+ RUN ldconfig
34+ WORKDIR /
35+ RUN ls
36+
37+ ADD requirements.txt /
38+ RUN pip install -r requirements.txt
39+
40+ # build tesseract
41+ RUN wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
42+ RUN tar -zxvf tesseract-ocr-3.02.02.tar.gz
43+ WORKDIR tesseract-ocr/
44+ RUN ./autogen.sh
45+ RUN ./configure
46+ RUN make
47+ RUN make install
48+ RUN ldconfig
49+ RUN cd ..
50+
51+ # download the relevant Tesseract English Language Packages
52+ RUN wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
53+ RUN tar -xf tesseract-ocr-3.02.eng.tar.gz
54+ RUN sudo cp -r tesseract-ocr/tessdata /usr/local/share/
55+
56+ # update working directories
57+ ADD ./flask_server /flask_server
58+ WORKDIR /flask_server
59+
60+ EXPOSE 80
61+ CMD ["python" , "app.py" ]
0 commit comments