Unverified Commit 03e5833b authored by Fernando Verdugo's avatar Fernando Verdugo Committed by GitHub
Browse files

369 dockers (#1247)

feature(docker): ravada from dockers

Issue #369
parent ec4d0218
......@@ -16,4 +16,5 @@ yarn.lock
node_modules/
t/vm/b10*
public/fallback
.cache/
public/img/version-*svg
# ravada
[![GitHub version](https://img.shields.io/badge/version-0.2.17-brightgreen.svg)](https://github.com/UPC/ravada/releases) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://github.com/UPC/ravada/blob/master/LICENSE)
[![GitHub version](https://img.shields.io/badge/version-0.4.3-brightgreen.svg)](https://github.com/UPC/ravada/releases) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://github.com/UPC/ravada/blob/master/LICENSE)
[![Documentation Status](https://readthedocs.org/projects/ravada/badge/?version=latest)](http://ravada.readthedocs.io/en/latest/?badge=latest)
[![Follow twitter](https://img.shields.io/twitter/follow/ravada_vdi.svg?style=social&label=Twitter&style=flat-square)](https://twitter.com/ravada_vdi)
[![Telegram Group](https://img.shields.io/badge/Telegram-Group-blue.svg)](https://t.me/ravadavdi)
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
<sup>**Frontend:**</sup><!-- [![Docker Stars](https://img.shields.io/docker/stars/ravada/front.svg?style=flat)](https://hub.docker.com/r/ravada/front/) -->
[![Docker Pulls](https://img.shields.io/docker/pulls/ravada/front.svg?style=flat)](https://hub.docker.com/r/ravada/front/)
[![](https://images.microbadger.com/badges/image/ravada/front.svg)](https://microbadger.com/images/ravada/front "Get your own image badge on microbadger.com")
<sup>**Backend:**</sup><!-- [![Docker Stars](https://img.shields.io/docker/stars/ravada/back.svg?style=flat)](https://hub.docker.com/r/ravada/back/)-->
[![Docker Pulls](https://img.shields.io/docker/pulls/ravada/back.svg?style=flat)](https://hub.docker.com/r/ravada/back/)
[![](https://images.microbadger.com/badges/image/ravada/back.svg)](https://microbadger.com/images/ravada/back "Get your own image badge on microbadger.com")
## Remote Virtual Desktops Manager
......
version: "3.5"
services:
ravada-mysql:
container_name: ravada-mysql
volumes:
- "/opt/ravada/mysql:/var/lib/mysql"
- "/etc/localtime:/etc/localtime:ro"
- "/opt/ravada/log:/var/log/mysql"
networks:
- ravada_network
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
environment:
- MYSQL_DATABASE=ravada
- MYSQL_ROOT_PASSWORD=Pword12345*
- MYSQL_HOST=127.0.0.1
- MYSQL_PORT=33306
- MYSQL_USER=rvd_user
- MYSQL_PASSWORD=Pword12345*
- MYSQL_MY_DATABASE=ravada
ravada-front:
container_name: ravada-front
volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "~/src/ravada:/ravada"
- "/opt/ravada/screenshots:/var/www/img/screenshots"
ports:
- "3000:3000"
expose:
- "3000"
networks:
- ravada_network
#image download from dockerhub
image: ravada/front
#build to build from sources
#build: dockers/front/.
restart: unless-stopped
depends_on:
- ravada-mysql
ravada-back:
container_name: ravada-back
volumes:
- "sshkeys:/root/.ssh"
- "/opt/ravada/certs/default:/etc/pki/libvirt-spice"
- "/opt/ravada/images:/var/lib/libvirt/images"
- "/opt/ravada/screenshots:/var/www/img/screenshots"
- "/opt/ravada/etc:/etc/libvirt/qemu"
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- "~/src/ravada:/ravada"
ports:
- "5900-5999:5900-5999"
- "55900-55999:55900-55999"
networks:
- ravada_network
#image download from dockerhub
image: ravada/back
#build to build from sources
#build: dockers/back/.
privileged: true
restart: unless-stopped
depends_on:
- ravada-mysql
volumes:
sshkeys:
networks:
ravada_network:
external: false
name: ravada_network
FROM ubuntu:18.04
LABEL maintainer="ravada@telecos.upc.edu"
LABEL description="Ravada Backend + KVM"
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
perl libmojolicious-perl libauthen-passphrase-perl \
libdbd-mysql-perl libdbi-perl libdbix-connector-perl libipc-run3-perl libnet-ldap-perl \
libproc-pid-file-perl libsys-virt-perl libxml-libxml-perl libconfig-yaml-perl \
libmoose-perl libjson-xs-perl perlmagick libmoosex-types-netaddr-ip-perl libsys-statistics-linux-perl \
libio-interface-perl libiptables-chainmgr-perl libnet-dns-perl liblocale-maketext-lexicon-perl \
libmojolicious-plugin-i18n-perl libdbd-sqlite3-perl debconf adduser libdigest-sha-perl libnet-ssh2-perl \
libfile-rsync-perl libdate-calc-perl libparallel-forkmanager-perl libdatetime-perl libencode-locale-perl netcat-openbsd \
liblwp-useragent-determined-perl libvirt-clients supervisor net-tools openssh-client apt-utils curl libpbkdf2-tiny-perl \
libio-stringy-perl libvirt-daemon-system libvirt-clients netcat-openbsd qemu-kvm qemu-utils iproute2 wget bridge-utils firewalld dnsmasq iptables ebtables \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ADD http://infoteleco.upc.edu/img/debian/libmojolicious-plugin-renderfile-perl_0.10-1_all.deb /tmp/
RUN dpkg -i /tmp/libmojolicious-plugin-renderfile-perl_0.10-1_all.deb \
&& rm /tmp/libmojolicious-plugin-renderfile-perl_0.10-1_all.deb \
&& echo "listen_tls = 0" >> /etc/libvirt/libvirtd.conf \
&& echo 'listen_tcp = 1' >> /etc/libvirt/libvirtd.conf \
# && mkdir -p /root/.ssh \
# && echo "Host ravada-kvm StrictHostKeyChecking no" >/root/.ssh/config \
# && chmod 600 /root/.ssh/config \
&& mkdir -p /var/log/supervisor \
&& mkdir -p /run/sshd
COPY network.sh default.xml /
EXPOSE 5900-5950
EXPOSE 55900-55950
COPY supervisord.conf /etc/supervisord.conf
#RUN mkdir /ravada
#ADD src/ravada /ravada
COPY ravada.conf /etc/ravada.conf
WORKDIR /ravada
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
<network>
<name>default</name>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254'/>
</dhcp>
</ip>
</network>
\ No newline at end of file
#!/bin/sh
chmod 666 /dev/kvm
virsh net-define --file default.xml
virsh net-start default
virsh net-autostart --network default
\ No newline at end of file
db:
user: rvd_user
password: Pword12345*
host: ravada-mysql
\ No newline at end of file
[supervisord]
user=root
nodaemon=true
logfile=/dev/stdout
loglevel=error
logfile_maxbytes=0
[program:virtlogd]
command=virtlogd
autostart=true
autorestart=true
stdout_logfile=NONE
stderr_logfile=NONE
priority=1
[program:libvirt]
command=libvirtd
autostart=true
autorestart=true
startsecs=5
priority=2
[program:rvd_back]
command=bin/rvd_back.pl
autorestart=true
startretries=3
priority=5
[program:app]
command=sh network.sh
directory=/
startsecs = 8
autorestart = false
startretries = 1
priority=6
\ No newline at end of file
FROM ubuntu:18.04
LABEL maintainer="ravada@telecos.upc.edu"
LABEL description="Ravada Frontend"
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
perl libmojolicious-perl libauthen-passphrase-perl \
libdbd-mysql-perl libdbi-perl libdbix-connector-perl libipc-run3-perl libnet-ldap-perl \
libproc-pid-file-perl libsys-virt-perl libxml-libxml-perl libconfig-yaml-perl \
libmoose-perl libjson-xs-perl perlmagick libmoosex-types-netaddr-ip-perl libsys-statistics-linux-perl \
libio-interface-perl libiptables-chainmgr-perl libnet-dns-perl liblocale-maketext-lexicon-perl \
libmojolicious-plugin-i18n-perl libdbd-sqlite3-perl debconf adduser libdigest-sha-perl libnet-ssh2-perl libpbkdf2-tiny-perl \
libfile-rsync-perl libdate-calc-perl libparallel-forkmanager-perl libdatetime-perl libencode-locale-perl netcat-openbsd \
libio-stringy-perl libvirt-clients liblwp-useragent-determined-perl supervisor net-tools apt-utils lsof mysql-client \
curl bash vim wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ADD http://infoteleco.upc.edu/img/debian/libmojolicious-plugin-renderfile-perl_0.10-1_all.deb /tmp/
RUN dpkg -i /tmp/libmojolicious-plugin-renderfile-perl_0.10-1_all.deb \
&& rm /tmp/libmojolicious-plugin-renderfile-perl_0.10-1_all.deb \
&& mkdir -p /var/log/supervisor \
&& mkdir -p /run/sshd
EXPOSE 3000
ENV PERL5LIB /root/local/lib/perl5:/root/lib/:/ravada
COPY supervisord.conf /etc/supervisord.conf
#RUN mkdir /ravada
#ADD src/ravada /ravada
COPY ravada.conf /etc/ravada.conf
WORKDIR /ravada
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
db:
user: rvd_user
password: Pword12345*
host: ravada-mysql
\ No newline at end of file
[supervisord]
user=root
nodaemon=true
logfile=/dev/stdout
loglevel=error
logfile_maxbytes=0
[program:rvd_front]
command=/usr/bin/morbo rvd_front.pl
autostart=true
autorestart=true
startsecs=5
priority=1
\ No newline at end of file
#!/bin/bash
read -r -p "Remove images (front - back - mysql) - Are you sure? [Y/n]" response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]] || [[ -z $response ]]; then
docker image rm mysql:5.7
docker image rm ravada/front:latest
docker image rm ravada/back:latest
fi
read -r -p "Remove volume dockerfy_sshkeys - Are you sure? [Y/n]" response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]] || [[ -z $response ]]; then
docker volume rm dockerfy_sshkeys
fi
read -r -p "Remove persistent data (/opt/ravada/) - Are you sure? [Y/n]" response
response=${response,,} # tolower
if [[ $response =~ ^(yes|y| ) ]] || [[ -z $response ]]; then
rm -rfv /opt/ravada/*
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment