forked from openstate/open-raadsinformatie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
226 lines (197 loc) · 6.52 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
FROM ubuntu:14.04
MAINTAINER Sicco van Sas <[email protected]>
# Use bash as default shell
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Add multiverse to sources
RUN echo 'deb http://archive.ubuntu.com/ubuntu/ precise multiverse' >> etc/apt/sources.list
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
#Set Timezone
RUN echo "Europe/Amsterdam" > /etc/timezone \
&& dpkg-reconfigure -f noninteractive tzdata
RUN apt-get update \
&& apt-get install -y \
python-dev \
python-setuptools \
python-software-properties \
openjdk-7-jre-headless \
wget \
curl \
poppler-utils \
software-properties-common \
gettext \
git \
vim
# according to http://www.monblocnotes.com/node/2057
RUN sed -i 's/exit 101/exit 0/' /usr/sbin/policy-rc.d
# according to http://www.monblocnotes.com/node/2057
RUN sed -i 's/exit 101/exit 0/' /usr/sbin/policy-rc.d
RUN apt-get install -y redis-server
RUN service redis-server start
# Install elasticsearch
ENV ES_VERSION 1.4.2
RUN wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ES_VERSION}.deb
RUN dpkg -i elasticsearch-${ES_VERSION}.deb > /dev/null
RUN sed -i 's/#discovery.zen.ping.multicast.enabled: false/discovery.zen.ping.multicast.enabled: false/' /etc/elasticsearch/elasticsearch.yml
RUN service elasticsearch start
RUN rm elasticsearch-${ES_VERSION}.deb
# Install elasticsearch head plugin
RUN /usr/share/elasticsearch/bin/plugin --install mobz/elasticsearch-head
RUN apt-get install -y \
make \
libxml2-dev \
libxslt1-dev \
libssl-dev \
libffi-dev \
libtiff4-dev \
libjpeg8-dev \
liblcms2-dev \
python-dev \
python-setuptools \
python-virtualenv \
git \
supervisor \
vim
RUN easy_install pip
##### Install dependencies for pyav #####
RUN apt-get install -y \
libfaac-dev \
libgpac-dev \
checkinstall \
libmp3lame-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
librtmp-dev \
libtheora-dev \
libvorbis-dev \
pkg-config \
yasm \
zlib1g-dev
# Temporarily use /tmp as workdir for the pyav dependencies
WORKDIR /tmp
RUN git clone https://github.com/izderadicka/pdfparser.git \
&& cd pdfparser \
&& sudo apt-get -y install libtool pkg-config gettext fontconfig libfontconfig1-dev autoconf libzip-dev libtiff5-dev libopenjpeg-dev \
&& git clone --depth 1 git://git.freedesktop.org/git/poppler/poppler poppler_src \
&& cd poppler_src/ \
&& ./autogen.sh \
&& ./configure --disable-poppler-qt4 --disable-poppler-qt5 --disable-poppler-cpp --disable-gtk-test --disable-splash-output --disable-utils \
&& make \
&& make install \
&& cp poppler/.libs/libpoppler.so.?? ../pdfparser/ \
&& ldconfig
ENV YASM_VERSION 1.2.0
RUN curl -sSL http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz | \
tar -xz \
&& cd yasm-${YASM_VERSION} \
&& ./configure \
&& make \
&& make install
#ENV x264_COMMIT 121396c71b4907ca82301d1a529795d98daab5f8
RUN git clone --depth 1 git://git.videolan.org/x264 \
&& cd x264 \
#&& git checkout -q $x264_COMMIT \
&& ./configure --enable-shared \
&& checkinstall \
--pkgname=x264 \
--pkgversion="3:$(./version.sh | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" \
--backup=no \
--deldoc=yes \
--fstrans=no \
--default
ENV FDKAAC_VERSION 0.1.0
RUN curl -sSL http://downloads.sourceforge.net/opencore-amr/fdk-aac-${FDKAAC_VERSION}.tar.gz | \
tar -xz \
&& cd fdk-aac-${FDKAAC_VERSION} \
&& ./configure --enable-shared \
&& make \
&& checkinstall \
--pkgname=fdk-aac \
--pkgversion=${FDKAAC_VERSION} \
--backup=no \
--deldoc=yes \
--fstrans=no \
--default
#ENV LIBVPX_COMMIT ccc9e1da8d1ef03a471ab227e1049cd55bebd806
RUN git clone --depth 1 https://chromium.googlesource.com/webm/libvpx \
&& cd libvpx \
#&& git checkout -q $LIBVPX_COMMIT \
&& ./configure --enable-shared \
&& make \
&& checkinstall \
--pkgname=libvpx \
--pkgversion="1:$(date +%Y%m%d%H%M)-git" \
--backup=no \
--deldoc=yes \
--fstrans=no \
--default
RUN cd x264 \
&& make distclean \
&& ./configure --enable-static --enable-shared --enable-pic \
&& make \
&& checkinstall \
--pkgname=x264 \
--pkgversion="3:$(./version.sh | awk -F'[" ]' '/POINT/{print $4"+git"$5}')" \
--backup=no \
--deldoc=yes \
--fstrans=no \
--default
ENV XVIDCORE_VERSION 1.3.2
RUN curl -sSL http://mirror.ryansanden.com/ffmpeg-d00bc6a8/xvidcore-${XVIDCORE_VERSION}.tar.gz | \
tar -xz \
&& cd xvidcore/build/generic \
&& ./configure --prefix='/usr/local' \
&& make \
&& make install
#ENV FFMPEG_COMMIT 580c86925ddf8c85d2e6f57ed55dd75853748b29
RUN git clone git://source.ffmpeg.org/ffmpeg.git \
&& cd ffmpeg \
&& git checkout release/2.4 \
#&& git checkout -q $FFMPEG_COMMIT \
&& ./configure \
--enable-shared \
--enable-gpl \
--enable-libfaac \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-librtmp \
--enable-libtheora \
--enable-libvorbis \
--enable-libx264 \
--enable-nonfree \
--enable-version3 \
--enable-libxvid \
&& make \
&& make install \
&& ldconfig
##########
WORKDIR /opt/ori
# Create a virtualenv project
RUN echo 'ok'
RUN virtualenv -q /opt
RUN echo "source /opt/bin/activate; cd /opt/ori;" >> ~/.bashrc
# Temporarily add all NPO Backstage files on the host to the container
# as it contains files needed to finish the base installation
ADD . /opt/ori
# Install Python requirements
RUN source ../bin/activate \
&& python -m pip install -U pip \
&& pip install Cython==0.21.2 \
&& pip install -r requirements.txt \
&& cd /tmp/pdfparser \
&& python setup.py install
# Start
RUN source ../bin/activate \
&& service elasticsearch restart \
&& sleep 20 \
&& ./manage.py elasticsearch create_indexes es_mappings/ \
&& ./manage.py elasticsearch put_template
RUN apt-get install supervisor
# Delete all NPO Bastage files again
RUN find . -delete
# When the container is created or started run start.sh which starts
# all required services and supervisor which starts celery and celerycam
# CMD /opt/ori/start.sh