Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#
# Dockerfile to launch WebVirtMgr, see:
# https://github.com/retspen/webvirtmgr
#
# Build with:
# docker build --no-cache=true --rm=true -t webvirtmgr .
#
# Customize:
# * Replace 'authorized_keys' with your key(s) so you can login and inspect the container.
#
# Default credentials (in initial_data.json): L: admin P: admin
#

FROM centos:6

ENV VERSION 0.1

MAINTAINER nuno.tavares@synrix.com

RUN yum clean all && \
yum -y update && \
yum -y install http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm && \
yum -y install git python-pip libvirt-python libxml2-python python-websockify \
supervisor nginx

#
# For debugging
#
RUN yum clean all && \
yum -y install telnet openssh-server sudo && \
service sshd start && \
service sshd stop && \
yum clean all

RUN mkdir /var/www && \
cd /var/www && \
git clone git://github.com/retspen/webvirtmgr.git webvirtmgr

COPY initial_data.json /var/www/webvirtmgr

RUN cd /var/www/webvirtmgr && \
pip install -r requirements.txt && \
cd /var/www/webvirtmgr && \
./manage.py syncdb --noinput && \
./manage.py loaddata ./initial_data.json && \
./manage.py collectstatic --noinput && \
chown -R nginx:nginx /var/www/webvirtmgr



#
# Installation instructions from:
# https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization
#
RUN mkdir -p /var/lib/nginx/.ssh && \
chmod 700 /var/lib/nginx/.ssh && \
ssh-keygen -t rsa -C "webvirtmgr@portavita.nl" -P '' -f /var/lib/nginx/.ssh/id_rsa && \
touch /var/lib/nginx/.ssh/config && \
echo -e "StrictHostKeyChecking=no\nUserKnownHostsFile=/dev/null" >> /var/lib/nginx/.ssh/config && \
mkdir -p /root/.ssh && \
chmod 700 /root/.ssh && \
chown nginx:nginx -R /var/lib/nginx && \
sed -i 's,^user nginx;,user nginx;\ndaemon off;,' /etc/nginx/nginx.conf && \
rm -f /etc/nginx/conf.d/default.conf

COPY authorized_keys /root/.ssh/authorized_keys

COPY nginx_conf.d_webvirtmgr.conf /etc/nginx/conf.d/webvirtmgr.conf



COPY supervisor.d_webvirtmgr.ini /etc/supervisord.conf

EXPOSE 22 80

ENTRYPOINT ["/usr/bin/supervisord"]
1 change: 1 addition & 0 deletions deploy/docker/authorized_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA7rvoRSm8Ec7XSc4vg5om03DkZl8E7wY4K1SfuD1pgWolXcTE3m1+ivhXg7VGSUJB1vYU9Im1XbGZIgLVsZBcfTFG6OCEZp0BgO6qROulXQ/c5ZPAl21+hl+VKKZvHEIsQf3M2woSXOsZOcsblAcR4PUZTwSqPcqgWUKfLAUEq3B8UNhp9xKRXaN+4/4xnCJplLqW5xqFSjH5U/t4v7KMNroUB/9t2BvMdNDOK8gFAm/7Ec1cXG5tVVQ7sa+CA8tWgsOI6v+kKC3OD8i+Dlrip+fzqcGWFogUukY9oUNqxDQ4PhvwOZNwdLX7RMaU7KvHNhU6sjiVREZEJ/teQxsivQ== n.tavares@portavita.eu
263 changes: 263 additions & 0 deletions deploy/docker/initial_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
[
{
"pk": 1,
"model": "auth.permission",
"fields": {
"codename": "add_permission",
"name": "Can add permission",
"content_type": 1
}
},
{
"pk": 2,
"model": "auth.permission",
"fields": {
"codename": "change_permission",
"name": "Can change permission",
"content_type": 1
}
},
{
"pk": 3,
"model": "auth.permission",
"fields": {
"codename": "delete_permission",
"name": "Can delete permission",
"content_type": 1
}
},
{
"pk": 4,
"model": "auth.permission",
"fields": {
"codename": "add_group",
"name": "Can add group",
"content_type": 2
}
},
{
"pk": 5,
"model": "auth.permission",
"fields": {
"codename": "change_group",
"name": "Can change group",
"content_type": 2
}
},
{
"pk": 6,
"model": "auth.permission",
"fields": {
"codename": "delete_group",
"name": "Can delete group",
"content_type": 2
}
},
{
"pk": 7,
"model": "auth.permission",
"fields": {
"codename": "add_user",
"name": "Can add user",
"content_type": 3
}
},
{
"pk": 8,
"model": "auth.permission",
"fields": {
"codename": "change_user",
"name": "Can change user",
"content_type": 3
}
},
{
"pk": 9,
"model": "auth.permission",
"fields": {
"codename": "delete_user",
"name": "Can delete user",
"content_type": 3
}
},
{
"pk": 10,
"model": "auth.permission",
"fields": {
"codename": "add_contenttype",
"name": "Can add content type",
"content_type": 4
}
},
{
"pk": 11,
"model": "auth.permission",
"fields": {
"codename": "change_contenttype",
"name": "Can change content type",
"content_type": 4
}
},
{
"pk": 12,
"model": "auth.permission",
"fields": {
"codename": "delete_contenttype",
"name": "Can delete content type",
"content_type": 4
}
},
{
"pk": 13,
"model": "auth.permission",
"fields": {
"codename": "add_session",
"name": "Can add session",
"content_type": 5
}
},
{
"pk": 14,
"model": "auth.permission",
"fields": {
"codename": "change_session",
"name": "Can change session",
"content_type": 5
}
},
{
"pk": 15,
"model": "auth.permission",
"fields": {
"codename": "delete_session",
"name": "Can delete session",
"content_type": 5
}
},
{
"pk": 16,
"model": "auth.permission",
"fields": {
"codename": "add_site",
"name": "Can add site",
"content_type": 6
}
},
{
"pk": 17,
"model": "auth.permission",
"fields": {
"codename": "change_site",
"name": "Can change site",
"content_type": 6
}
},
{
"pk": 18,
"model": "auth.permission",
"fields": {
"codename": "delete_site",
"name": "Can delete site",
"content_type": 6
}
},
{
"pk": 19,
"model": "auth.permission",
"fields": {
"codename": "add_compute",
"name": "Can add compute",
"content_type": 7
}
},
{
"pk": 20,
"model": "auth.permission",
"fields": {
"codename": "change_compute",
"name": "Can change compute",
"content_type": 7
}
},
{
"pk": 21,
"model": "auth.permission",
"fields": {
"codename": "delete_compute",
"name": "Can delete compute",
"content_type": 7
}
},
{
"pk": 22,
"model": "auth.permission",
"fields": {
"codename": "add_instance",
"name": "Can add instance",
"content_type": 8
}
},
{
"pk": 23,
"model": "auth.permission",
"fields": {
"codename": "change_instance",
"name": "Can change instance",
"content_type": 8
}
},
{
"pk": 24,
"model": "auth.permission",
"fields": {
"codename": "delete_instance",
"name": "Can delete instance",
"content_type": 8
}
},
{
"pk": 25,
"model": "auth.permission",
"fields": {
"codename": "add_flavor",
"name": "Can add flavor",
"content_type": 9
}
},
{
"pk": 26,
"model": "auth.permission",
"fields": {
"codename": "change_flavor",
"name": "Can change flavor",
"content_type": 9
}
},
{
"pk": 27,
"model": "auth.permission",
"fields": {
"codename": "delete_flavor",
"name": "Can delete flavor",
"content_type": 9
}
},
{
"pk": 1,
"model": "auth.user",
"fields": {
"username": "admin",
"first_name": "",
"last_name": "",
"is_active": true,
"is_superuser": true,
"is_staff": true,
"last_login": "2016-11-21T20:30:58.604Z",
"groups": [],
"user_permissions": [],
"password": "pbkdf2_sha256$10000$oYZbF7Gvt8dZ$DEHkJPeBIyPgTUp5jG+NInOhc2pLTiMkZwxrh7uQh7c=",
"email": "",
"date_joined": "2016-11-21T20:30:58.604Z"
}
}
]
24 changes: 24 additions & 0 deletions deploy/docker/nginx_conf.d_webvirtmgr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

server {
listen 80 default_server;

server_name $hostname;
#access_log /var/log/nginx/webvirtmgr_access_log;

location /static/ {
root /var/www/webvirtmgr/webvirtmgr;
expires max;
}

location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
client_max_body_size 1024M; # Set higher depending on your needs
}
}
Loading