-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtg_base_appengine.Dockerfile
112 lines (89 loc) · 2.65 KB
/
tg_base_appengine.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
FROM gcr.io/google_appengine/python
# To prevent `debconf: unable to initialize frontend: Dialog` error
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHON_VERSION 2.7
ENV OPENCV_VERSION 3.1.0
ENV NUM_CORES 32
RUN NUM_CORES=$(nproc)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
pkg-config \
build-essential \
libfreetype6-dev \
libpng12-dev \
wget \
python$PYTHON_VERSION-dev \
unzip \
cmake \
git \
ssh \
libatlas-base-dev \
libboost-all-dev \
gfortran \
libtbb2 \
libtbb-dev \
libjasper-dev \
libgtk2.0-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libjpeg-dev \
libtiff-dev \
libhdf5-dev \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python get-pip.py
RUN pip install numpy matplotlib
#dlib
WORKDIR /
RUN git clone https://github.com/davisking/dlib.git
WORKDIR /dlib
RUN python setup.py install --yes USE_AVX_INSTRUCTIONS
#OpenCV
WORKDIR /
RUN wget https://github.com/Itseez/opencv/archive/${OPENCV_VERSION}.zip -O opencv3.zip
RUN unzip -q opencv3.zip
RUN mv /opencv-${OPENCV_VERSION} /opencv
RUN rm opencv3.zip
#RUN wget https://github.com/Itseez/opencv_contrib/archive/${OPENCV_VERSION}.zip -O opencv_contrib3.zip
#RUN unzip -q opencv_contrib3.zip
#RUN mv /opencv_contrib-${OPENCV_VERSION} /opencv_contrib
#RUN rm opencv_contrib3.zip
RUN mkdir /opencv/build
WORKDIR /opencv/build
RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=$(python -c "import sys; print(sys.prefix)") \
# -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
-D PYTHON_EXECUTABLE=$(which python) \
-D BUILD_EXAMPLES=OFF \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D INSTALL_TESTS=OFF \
-D BUILD_opencv_java=OFF \
-D WITH_IPP=OFF \
-D WITH_TBB=ON \
-D WITH_QT=OFF ..
RUN make -j$NUM_CORES
RUN make install && make clean
RUN ldconfig
WORKDIR /
COPY requirements.txt .
RUN pip install -r requirements.txt
# Get the maxmind geoip db. TODO: have this auto-update
WORKDIR /usr/local/lib/python2.7/dist-packages/maxminddb
RUN wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
RUN gzip -d GeoLite2-Country.mmdb.gz
WORKDIR /
# Make ssh dir
RUN mkdir /root/.ssh/
# Copy over private key, and set permissions
COPY id_rsa /root/.ssh/id_rsa
# Create known_hosts
RUN touch /root/.ssh/known_hosts
# Add bitbucket key
RUN ssh-keyscan bitbucket.org >> /root/.ssh/known_hosts
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN git clone git@bitbucket.org:trendiGuru/rq-tg.git && pip install -e rq-tg
RUN git clone git@github.com:trendiguru/core.git /usr/lib/python2.7/dist-packages/trendi
CMD ["bash"]