forked from mplx/docker-webvirtcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (56 loc) · 2.21 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
# fork from mplx/docker-webvirtcloud
FROM phusion/baseimage:0.11
EXPOSE 80
CMD ["/sbin/my_init"]
RUN apt-get update -qqy && \
DEBIAN_FRONTEND=noninteractive apt-get -qyy install \
-o APT::Install-Suggests=false \
python-virtualenv \
python-dev \
libxml2-dev \
libvirt-dev \
zlib1g-dev \
nginx \
supervisor \
libsasl2-modules \
unzip \
curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
mkdir -p /srv
WORKDIR /srv
RUN git clone https://github.com/retspen/webvirtcloud.git && \
rm -Rf webvirtcloud/doc/ webvirtcloud/Vagrantfile && \
cp webvirtcloud/conf/supervisor/webvirtcloud.conf /etc/supervisor/conf.d && \
cp webvirtcloud/conf/nginx/webvirtcloud.conf /etc/nginx/conf.d && \
chown -R www-data:www-data /srv/webvirtcloud/ && \
cd /srv/webvirtcloud/ && \
mkdir data && \
cp webvirtcloud/settings.py.template webvirtcloud/settings.py && \
sed -i "s|'db.sqlite3'|'data/db.sqlite3'|" webvirtcloud/settings.py && \
virtualenv venv && \
. venv/bin/activate && \
venv/bin/pip install -r conf/requirements.txt && \
chown -R www-data:www-data /srv/webvirtcloud/ && \
rm /etc/nginx/sites-enabled/default && \
echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \
chown -R www-data:www-data /var/lib/nginx && \
mkdir /etc/service/nginx && \
mkdir /etc/service/nginx-log-forwarder && \
mkdir /etc/service/webvirtcloud && \
mkdir /etc/service/novnc && \
cp conf/runit/nginx /etc/service/nginx/run && \
cp conf/runit/nginx-log-forwarder /etc/service/nginx-log-forwarder/run && \
cp conf/runit/novncd.sh /etc/service/novnc/run && \
cp conf/runit/webvirtcloud.sh /etc/service/webvirtcloud/run && \
rm -rf /tmp/* /var/tmp/*
WORKDIR /srv/webvirtcloud
ADD 01-wsproxy.patch /srv/webvirtcloud/01-wsproxy.patch
ADD 02-forwardssl.patch /srv/webvirtcloud/02-forwardssl.patch
RUN patch -p1 -u <01-wsproxy.patch && \
patch -p1 -u <02-forwardssl.patch && \
cp conf/nginx/webvirtcloud.conf /etc/nginx/conf.d && \
chown -R www-data:www-data /etc/nginx/conf.d/webvirtcloud.conf && \
rm 01-wsproxy.patch && \
rm 02-forwardssl.patch
COPY startinit.sh /etc/my_init.d/startinit.sh