-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathDockerfile
65 lines (52 loc) · 1.43 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
#
# Stand-alone tesseract-ocr web service in python.
#
# Version: 0.0.3
# Developed by Mark Peng (markpeng.ntu at gmail)
#
FROM ubuntu:12.04
MAINTAINER guitarmind
RUN apt-get update && apt-get install -y \
autoconf \
automake \
autotools-dev \
build-essential \
checkinstall \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libtool \
python \
python-imaging \
python-tornado \
wget \
zlib1g-dev
RUN mkdir ~/temp \
&& cd ~/temp/ \
&& wget http://www.leptonica.org/source/leptonica-1.69.tar.gz \
&& tar -zxvf leptonica-1.69.tar.gz \
&& cd leptonica-1.69 \
&& ./configure \
&& make \
&& checkinstall \
&& ldconfig
RUN cd ~/temp/ \
&& wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz \
&& tar xvf tesseract-ocr-3.02.02.tar.gz \
&& cd tesseract-ocr \
&& ./autogen.sh \
&& mkdir ~/local \
&& ./configure --prefix=$HOME/local/ \
&& make \
&& make install \
&& cd ~/local/share \
&& wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz \
&& tar xvf tesseract-ocr-3.02.eng.tar.gz
ENV TESSDATA_PREFIX /root/local/share/tesseract-ocr
RUN mkdir -p /opt/ocr/static
COPY tesseractcapi.py /opt/ocr/tesseractcapi.py
COPY tesseractserver.py /opt/ocr/tesseractserver.py
RUN chmod 755 /opt/ocr/*.py
EXPOSE 1688
WORKDIR /opt/ocr
CMD ["python", "/opt/ocr/tesseractserver.py", "-p", "1688", "-b", "/root/local/lib", "-d", "/root/local/share/tesseract-ocr" ]