Docker image for Web-demo builder

This repository contains the Docker image for the Web-demo builder. You can use these images for a faster deploy of the Web-demo builder in your servers. As with most Docker images, you need a recent Linux x84_64 distribution. Follow the installation instructions to install Docker.

Below, you will find the basic commands you need to run to get the Web-demo builder up and running. After that, particular use cases are described.

Quick and easy use

The easiest way to get your container running with the Web-demo builder is to use the run_container.sh script, included in this repository. You just need to:

Install Docker in your operating system.

Get the file run_container.sh (you can find it in this repository) and edit it to configure the three environment variables defined at the top of it. You can leave WDB_DOCKER_DIR and WDB_WEBDEMOS_DIR with their default values. WDB_MATLAB_DIR is only needed if you are planning to run web-demos written for MATLAB.

Start Docker. In Ubuntu, you need to run sudo service docker start

Run the script: sudo -E ./run_container.sh

These steps will start a Web-demo builder instance. You can access it by opening your browser and going to http://localhost.

More detailed steps

The previous steps are enough. However, if you want to run it manually or get more details of what the script does, follow the steps below:

Choose a directory of your system where the virtual environments will be stored, for example /var/lib/docker-webdemobuilder. To simplify steps below, set this path to a variable by running: export WDB_DOCKER_DIR="/var/lib/docker-webdemobuilder"

Pre-load the virtual environments you will need with the following commands. Keep in mind that if, for example, you plan to only run MATLAB web-demos, then you only need the MATLAB virtual environment. You only need to run these commands only once.

The option -E to sudo ensures that any proxy settings (like the environment variable http_proxy) will be preserved for Docker.

Choose a directory of your system where the web-demos you generate will be stored, for example /var/lib/webdemobuilder-scripts. To simplify steps below, set this path to a variable by running: export WDB_WEBDEMOS_DIR="/var/lib/webdemobuilder-scripts"

If you plan to run MATLAB web-demos, you need to specify the directory of your MATLAB installation (where the bin/ directory resides). Specify this by running: export WDB_MATLAB_DIR="/usr/local/MATLAB/R2013a"

Open your web browser and go to http://localhost:8080. You are now accessing a Web-demo builder instance running inside a Docker container.

Advanced options

The previous steps are enough to run the Web-demo builder with Docker. However, there are some particular cases where you would need to set up additional configuration options. Below, you will find additional arguments you can pass to the docker run command shown in step 8 before.

Using always the latest code

The previous steps are enough to run the version of the Web-demo builder inside the Docker image. However, if you want to always update to the latest stable code when starting your container, you can use the following argument: -e update_code=true. This will download the latest stable code of the Web-demo builder, thus you automatically get improvements and bug fixes with no effort.

Behind a proxy

If you are behind a proxy, remember to specify it when launching your container, for example: -e http_proxy="http://HOST:PORT/"

Password protect the access

You can protect the access to the Web-demo builder by specifying an extra option when running docker run: -e WDB_USER_PASSWORD="user/password".

Change branch

The docker image allows to choose the branch where one wants to work on ("default" or "stable"). You can change it by specifying the option webdemo_branch. For example, to use the latest code in the "default" branch, use these arguments: -e webdemo_branch="default" -e update_code="true"

Development usage

If you want to change the Web-demo builder code (written in PHP/HTML/Javascript), you need to override the directory where it resides inside the Docker image, and modify the directory permissions: