-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
137 lines (115 loc) · 3.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
FROM ubuntu:14.04
MAINTAINER Open State Foundation <[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/ trusty multiverse' >> etc/apt/sources.list
# Set Dutch locale, needed to parse Dutch time data
RUN locale-gen nl_NL.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 \
dnsutils \
vim
RUN add-apt-repository ppa:mc3man/trusty-media \
&& apt-get update \
&& apt-get dist-upgrade -y
# 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 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 update \
&& apt-get install -y \
libfaac-dev \
libgpac-dev \
checkinstall \
libmp3lame-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
librtmp-dev \
libtheora-dev \
libvorbis-dev \
libx264-dev \
libfdk-aac-dev \
libvpx-dev \
libxvidcore-dev \
pkg-config \
yasm \
zlib1g-dev \
libavformat-dev \
libavcodec-dev \
libavdevice-dev \
libavutil-dev \
libswscale-dev \
libavresample-dev
# Temporarily use /tmp as workdir for the pyav dependencies
# WORKDIR /tmp
RUN apt-get install -y ffmpeg
##########
WORKDIR /opt/ocd
# Create a virtualenv project
RUN echo 'ok'
RUN virtualenv -q /opt
RUN source ../bin/activate \
&& pip install pip --upgrade
RUN echo "source /opt/bin/activate; cd /opt/ocd;" >> ~/.bashrc
# Temporarily add files on the host to the container
# as it contains files needed to finish the base installation
ADD . /opt/ocd
# Install Python requirements
# Install Python requirements
RUN source ../bin/activate \
&& pip install pycparser==2.13 \
&& pip install Cython==0.21.2 \
&& pip install -r requirements.txt
# Initialize
RUN source ../bin/activate \
&& service elasticsearch start \
&& sleep 20 \
&& ./manage.py elasticsearch create_indexes es_mappings/ \
&& ./manage.py elasticsearch put_template
RUN apt-get install -y supervisor
# Generate documentation
RUN source ../bin/activate && cd docs && make html
# Delete all 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/ocd/start.sh