1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-27 00:25:22 +00:00
webvirtcloud/Dockerfile

70 lines
1.7 KiB
Docker
Raw Normal View History

2022-11-29 12:48:58 +00:00
FROM phusion/baseimage:jammy-1.0.1
2020-06-26 13:31:41 +00:00
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
2020-10-16 22:23:32 +00:00
RUN apt-get update -qqy \
&& DEBIAN_FRONTEND=noninteractive apt-get -qyy install \
--no-install-recommends \
2020-06-26 13:31:41 +00:00
git \
2020-10-16 22:23:32 +00:00
python3-venv \
2020-06-26 13:31:41 +00:00
python3-dev \
python3-lxml \
libvirt-dev \
zlib1g-dev \
nginx \
2020-10-16 22:23:32 +00:00
pkg-config \
gcc \
libldap2-dev \
libssl-dev \
libsasl2-dev \
2020-10-16 22:23:32 +00:00
libsasl2-modules \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2020-06-26 13:31:41 +00:00
2020-10-16 22:23:32 +00:00
COPY . /srv/webvirtcloud
2015-10-15 12:47:10 +00:00
RUN chown -R www-data:www-data /srv/webvirtcloud
# Setup webvirtcloud
2020-10-16 22:23:32 +00:00
WORKDIR /srv/webvirtcloud
RUN python3 -m venv venv && \
2015-10-15 12:47:10 +00:00
. venv/bin/activate && \
pip3 install -U pip && \
2020-10-16 22:23:32 +00:00
pip3 install wheel && \
pip3 install -r conf/requirements.txt && \
2022-08-24 12:16:08 +00:00
pip3 cache purge && \
2015-10-15 12:47:10 +00:00
chown -R www-data:www-data /srv/webvirtcloud
2020-10-16 22:23:32 +00:00
RUN . venv/bin/activate && \
python3 manage.py makemigrations && \
2020-10-16 22:23:32 +00:00
python3 manage.py migrate && \
python3 manage.py collectstatic --noinput && \
2015-10-15 12:47:10 +00:00
chown -R www-data:www-data /srv/webvirtcloud
# Setup Nginx
2020-10-16 22:23:32 +00:00
RUN printf "\n%s" "daemon off;" >> /etc/nginx/nginx.conf && \
2015-10-15 12:47:10 +00:00
rm /etc/nginx/sites-enabled/default && \
chown -R www-data:www-data /var/lib/nginx
2020-10-16 22:23:32 +00:00
COPY conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/
2015-10-15 12:47:10 +00:00
# Register services to runit
RUN mkdir /etc/service/nginx && \
mkdir /etc/service/nginx-log-forwarder && \
mkdir /etc/service/webvirtcloud && \
mkdir /etc/service/novnc
2020-10-16 22:23:32 +00:00
COPY conf/runit/nginx /etc/service/nginx/run
COPY conf/runit/nginx-log-forwarder /etc/service/nginx-log-forwarder/run
COPY conf/runit/novncd.sh /etc/service/novnc/run
COPY conf/runit/webvirtcloud.sh /etc/service/webvirtcloud/run
2015-10-15 12:47:10 +00:00
# Define mountable directories.
#VOLUME []
2020-06-26 13:31:41 +00:00
WORKDIR /srv/webvirtcloud