2020-06-26 13:31:41 +00:00
|
|
|
FROM phusion/baseimage:18.04-1.0.0
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
EXPOSE 6080
|
|
|
|
|
|
|
|
# Use baseimage-docker's init system.
|
|
|
|
CMD ["/sbin/my_init"]
|
|
|
|
|
2015-10-15 12:47:10 +00:00
|
|
|
|
|
|
|
RUN echo 'APT::Get::Clean=always;' >> /etc/apt/apt.conf.d/99AutomaticClean
|
|
|
|
|
|
|
|
RUN apt-get update -qqy
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get -qyy install \
|
|
|
|
-o APT::Install-Suggests=false \
|
2020-06-26 13:31:41 +00:00
|
|
|
git \
|
|
|
|
python3-virtualenv \
|
|
|
|
python3-dev \
|
|
|
|
python3-lxml \
|
|
|
|
virtualenv \
|
|
|
|
libvirt-dev \
|
|
|
|
zlib1g-dev \
|
|
|
|
nginx \
|
|
|
|
libsasl2-modules
|
|
|
|
|
|
|
|
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
2015-10-15 12:47:10 +00:00
|
|
|
|
|
|
|
ADD . /srv/webvirtcloud
|
|
|
|
RUN chown -R www-data:www-data /srv/webvirtcloud
|
|
|
|
|
|
|
|
# Setup webvirtcloud
|
|
|
|
RUN cd /srv/webvirtcloud && \
|
2020-03-16 13:59:45 +00:00
|
|
|
virtualenv --python=python3 venv && \
|
2015-10-15 12:47:10 +00:00
|
|
|
. venv/bin/activate && \
|
2020-03-16 13:59:45 +00:00
|
|
|
pip3 install -U pip && \
|
|
|
|
pip3 install -r conf/requirements.txt && \
|
2015-10-15 12:47:10 +00:00
|
|
|
chown -R www-data:www-data /srv/webvirtcloud
|
|
|
|
|
|
|
|
RUN cd /srv/webvirtcloud && . venv/bin/activate && \
|
2020-03-16 13:59:45 +00:00
|
|
|
python3 manage.py migrate && \
|
2015-10-15 12:47:10 +00:00
|
|
|
chown -R www-data:www-data /srv/webvirtcloud
|
|
|
|
|
|
|
|
# Setup Nginx
|
|
|
|
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \
|
|
|
|
rm /etc/nginx/sites-enabled/default && \
|
|
|
|
chown -R www-data:www-data /var/lib/nginx
|
|
|
|
|
|
|
|
ADD conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/
|
|
|
|
|
|
|
|
# Register services to runit
|
|
|
|
RUN mkdir /etc/service/nginx && \
|
|
|
|
mkdir /etc/service/nginx-log-forwarder && \
|
|
|
|
mkdir /etc/service/webvirtcloud && \
|
|
|
|
mkdir /etc/service/novnc
|
|
|
|
ADD conf/runit/nginx /etc/service/nginx/run
|
|
|
|
ADD conf/runit/nginx-log-forwarder /etc/service/nginx-log-forwarder/run
|
|
|
|
ADD conf/runit/novncd.sh /etc/service/novnc/run
|
|
|
|
ADD conf/runit/webvirtcloud.sh /etc/service/webvirtcloud/run
|
|
|
|
|
|
|
|
# Define mountable directories.
|
|
|
|
#VOLUME []
|
|
|
|
|
2020-06-26 13:31:41 +00:00
|
|
|
WORKDIR /srv/webvirtcloud
|