Skip to content

Docker Installation & Update

catborise edited this page Jun 29, 2020 · 4 revisions

First Install Docker-ce (on host or guest): Official Docker Installation Guide

Steps:

  1. Install git, python
    sudo apt install git python
    or
    yum install git python
  2. Clone from repository
    git clone https://github.com/retspen/webvirtcloud.git
  3. Move to the installation folder
    cd webvirtcloud/
  4. Copy the setting.py file
    cp webvirtcloud/settings.py.template webvirtcloud/settings.py
  5. Generate random number using Python script:
    python3 conf/runit/secret_generator.py
  6. Copy ‘generated code’ and paste it to webvirtcloud/settings.py as SECRET_KEY = ’’
  7. Build the docker container
    docker build -t retspen/webvirtcloud:1 .
  8. Start the container. Use this command only for the first start
    docker run -d -p 80:80 -p 6080:6080 retspen/webvirtcloud:1
  9. (Optional) If you want you can change the port of the webpage by changing the previous command
    docker run -d -p <port>:80 -p 6080:6080 retspen/webvirtcloud:1
  10. Run browser enter host url with http.
  11. Login with: Username admin, password admin
  12. Change your admin password
  13. Add new host

Reverse Proxy

  1. Edit WS_PUBLIC_PORT in settings.py which is default value 6080
    ##Websock public port - 80 or 443 if reverse-proxy, else 6080
    WS_PUBLIC_PORT = 80
    
  2. Run webvirtcloud container with that command:
    docker run -d -p 80:80 retspen/webvirtcloud:1

Additional Information:

  1. Docker run command creates new container from base image.
  2. To stop docker container use:
    docker stop <container id>
  3. To get cointainer id use:
    docker ps -a
    or
    docker container ls
  4. After the first run, the container must be started with “start” command.
    docker start <container id>

Update Webvirtcloud:

  1. Enter running container
    docker exec -it <container id> /bin/bash
  2. Run followed commands
    cd /srv/webvirtcloud
    source venv/bin/activate
    git pull
    pip install -U -r conf/requirements.txt 
    python manage.py makemigrations
    python manage.py migrate
    
  3. Check webvirtcloud/settings.py.template to see if there is new configs… If it is, then copy them to webvirtcloud/settings.py file