Using Dundas BI Docker containers

1. Overview

Deploying Dundas BI using Docker containers allows you to access scaling and high availability features for cloud deployments or your own server clusters, for example using Kubernetes. Containers also isolate Dundas BI from other apps and your server's operating system, and allow you to manage the container resources.

This article details the steps to use and run Dundas BI Docker containers, including setting up Dundas BI application and warehouse databases, and running the different images. You can run images with either environment variables or mounted dbi.config files.

2. Dundas BI Docker Hub images

The Dundas BI Docker images are located in the Docker Hub under the Dundas organization. The following table lists the different Dundas BI repository images:

RepositoryDescription
dundas/dundas-bi-website Needed to run the Dundas BI application website.
dundas/dundas-bi-scheduler Runs the Dundas BI scheduler service for features including data cube storage jobs and notifications.
dundas/dundas-bi-full Runs the Dundas BI website with the scheduler also included in the same container.
dundas/dundas-bi-dt Needed to run the dt command line tool.
dundas/dundas-bi-setup Contains everything needed to create the application and warehouse databases used to run Dundas BI.

Dundas BI images are built off of the .NET Core Docker images and use the 3.1-bionic tag, which uses the Ubuntu 18.04 operating system.

3. Creating new Dundas BI application and warehouse databases

To create new application and warehouse databases run the following command, and replace {version} with the version you would like to set up:

docker run -it dundas/dundas-bi-setup:{version}

This will start the Dundas BI Deployment wizard. This is the same wizard as the one used when deploying in Linux with only options used for container deployments. See Installing Dundas BI on Linux for more information about using the Dundas BI Deployment wizard.

The Dundas BI container setup wizard.
The Dundas BI container setup wizard.

4. Setting connection to Dundas BI databases

There are two different ways to set the connection string: either by setting environment variables, or using a mounted volume that places a dbi.config file.

4.1. Environment variables

Docker environment variables are typically set in the following ways:

    • Compose file
    • Shell environment variables
    • Environment file
    • Dockerfile

Note
It is not recommended to set system wide environment variables when using Dundas BI as it will affect all instances of Dundas BI installed on that machine.

For more information see: Environment variables in Compose.

In order to start the Dundas BI Docker container you should set two environment variables:

Environment VariableDescription
DUNDAS_BI_APP_DB_CONN_STRING Represents the connection string to the Dundas BI application database.
DUNDAS_BI_APP_STORAGE Represents the type of database connection to use.
Valid values are SqlServer, or Postgres. If no value is supplied, SqlServer will be the default.

Note
Setting the connection for the Dundas BI databases is required for dundas/dundas-bi-website, dundas/dundas-bi-scheduler, and dundas/dundas-bi-dt. This is not required for starting dundas/dundas-bi-setup.

4.2. Mapped dbi.config file

An alternative to using environment variables is to use an un-encrypted dbi.config file. This can be done by mapping the file. The following is where the mapped file needs to be on the Docker container:

/usr/share/dundas/bi/Files/Container/www/BIWebsite/App_Data/dbi.config

For more information about mounting a file using volumes, see Use volumes in the Docker documentation.

4.3. Other environment variables

The following are additional environment variables, which set the respective Dundas BI configuration settings on the global scope before the application starts:

Environment VariableDescription
DUNDAS_BI_INTERNAL_APPLICATION_URL Sets the Dundas BI internal application URL.
DUNDAS_BI_EXTERNAL_APPLICATION_URL Sets the Dundas BI external application URL.

4.4. Dundas BI website port

The dundas/dundas-bi-website uses port 8080, so published ports should map to this when using published ports. You can find examples demonstrating this in the following section.

4.5. Examples

The following command can be executed to start the Dundas BI website with environment variables and a published port:

docker run -it -p:80:8080 \
-e DUNDAS_BI_APP_DB_CONN_STRING="Data Source=localhost;User Id=dbiuser;Password=pw;Initial Catalog=Dundas BI DockerTest" \
-e DUNDAS_BI_APP_STORAGE="SqlServer" \
dundas/dundas-bi-website:8.0.0

The following command can be executed to start the Dundas BI scheduler with environment variables:

docker run -it \
-e DUNDAS_BI_APP_DB_CONN_STRING="Data Source=localhost;User Id=dbiuser;Password=pw;Initial Catalog=Dundas BI DockerTest" \
-e DUNDAS_BI_APP_STORAGE="SqlServer" \
dundas/dundas-bi-scheduler:8.0.0

The following command can be executed to run the dt health check with environment variables:

docker run -it \
-e DUNDAS_BI_APP_DB_CONN_STRING="Data Source=localhost;User Id=dbiuser;Password=pw;Initial Catalog=Dundas BI DockerTest" \
-e DUNDAS_BI_APP_STORAGE="SqlServer" \
dundas/dundas-bi-dt:8.0.0 healthcheck

Note
The examples above use a connection string to an already-initialized Dundas BI application database.

The following command can be executed to start the Dundas BI website with a mounted dbi.config file:

docker run -it -p:80:8080 \
-v /dbi.config:/usr/share/dundas/bi/Files/Container/www/BIWebsite/App_Data/dbi.config \
dundas/dundas-bi-website:8.0.0

Note
The example above uses a local dbi.config file (/dbi.config) and maps to the Docker container (/usr/share/dundas/bi/Files/Container/www/BIWebsite/App_Data/dbi.config).

5. Kestrel and NGINX

The dundas/dundas-bi-website container uses a Kestrel web server. It is expected that if you require more options like SSL you will use another service like NGINX, IIS or Apache to handle this. For more information regarding Kestrel web server and reverse proxies, see Kestrel web server implementation in ASP.NET Core in Microsoft's documentation.

5.1. Using NGINX service as reverse proxy with Docker Compose

The following Docker Compose example contains two files that live in the same directory. In this example it assumes that you have a Dundas BI application, and warehouse database outside of Docker that is accessible, and already initialized. It is possible to run PostgreSQL or SQL Server as part of the docker-compose project, however this example does not cover that. Also, this example does not cover using SSL, however certificate can be mounted as volumes and to the NGINX service and can be added to the nginx.conf file.

Docker Compose Folder
    - docker-compose.yml
    - nginx.conf

nginx.conf

user  nginx;

events {
    worker_connections   1000;
}
http {
		 

        server {
              listen 80;
			  			  
              location / {
                proxy_pass http://dundas-bi-website:8080/;
                proxy_http_version 1.1;
                proxy_set_header   Upgrade $http_upgrade;
                proxy_set_header   Connection keep-alive;
                proxy_set_header   Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header   X-Forwarded-Proto $scheme;
                proxy_connect_timeout       86400;
                proxy_send_timeout          86400;
                proxy_read_timeout          86400;
                send_timeout                86400;
                client_max_body_size        500M;
              }
        }
}

docker-compose.yml

version: "3.1"

services:
   dundas-bi-website:
      image: dundas/dundas-bi-website:8.0.0
      expose:
         - "8080"
      environment:
         - DUNDAS_BI_APP_DB_CONN_STRING=Data Source=192.168.0.111;User Id=DundasUser;Password=4321;Initial Catalog=Dundas BI Docker
         - DUNDAS_BI_APP_STORAGE=SqlServer
         - DUNDAS_BI_INTERNAL_APPLICATION_URL=http://192.168.0.111:9010/
         - DUNDAS_BI_EXTERNAL_APPLICATION_URL=http://192.168.0.111:9010/
   dundas-bi-scheduler:
      image: dundas/dundas-bi-scheduler:8.0.0
      environment:
         - DUNDAS_BI_APP_DB_CONN_STRING=Data Source=192.168.0.111;User Id=DundasUser;Password=4321;Initial Catalog=Dundas BI Docker
         - DUNDAS_BI_APP_STORAGE=SqlServer
   nginx:
      image: nginx:latest
      volumes:
         - ./nginx.conf:/etc/nginx/nginx.conf:ro
      depends_on:
         - dundas-bi-website
      ports:
         - 9010:80      

This Docker Compose file can be run by opening a command prompt, navigating to the Docker Compose folder and then running the following command:

docker-compose up

This will create the Dundas BI containers and start them. The website will be available through NGINX and port 9010 as defined in the docker-compose file above.

5.2. Scaling the Docker Compose project

The Docker Compose example above can easily be scaled by doing the following:

docker-compose up --scale dundas-bi-website=3

This will create 3 running replicas of the dundas-bi-website service, and handle the load balancing.

For more information about using Docker Compose, see Overview of Docker Compose in the Docker documentation.

5.3. Deploying to Kubernetes clusters using Docker

Deploying to Kubernetes is commonly done using Helm charts, but the docker-compose project above can also be used.

To use Docker for deploying to Kubernetes instead of Helm charts, you can modify the docker-compose.yml example above like the following:

docker-compose.yml

version: "3.7"

services:
   dundas-bi-website:
      image: dundas/dundas-bi-website:8.0.0
      environment:
         - DUNDAS_BI_APP_DB_CONN_STRING=Data Source=192.168.0.111;User Id=DundasUser;Password=4321;Initial Catalog=Dundas BI Docker
         - DUNDAS_BI_APP_STORAGE=SqlServer
         - DUNDAS_BI_INTERNAL_APPLICATION_URL=http://192.168.0.111:9010/
         - DUNDAS_BI_EXTERNAL_APPLICATION_URL=http://192.168.0.111:9010/
      deploy:
         replicas: 3
   dundas-bi-scheduler:
      image: dundas/dundas-bi-scheduler:8.0.0
      environment:
         - DUNDAS_BI_APP_DB_CONN_STRING=Data Source=192.168.0.111;User Id=DundasUser;Password=4321;Initial Catalog=Dundas BI Docker
         - DUNDAS_BI_APP_STORAGE=SqlServer
   nginx:
      image: nginx:latest
      volumes:
         - /C/DockerExample/nginx.conf:/etc/nginx/nginx.conf:ro

      ports:
         - 9010:80      

Next run the following command:

docker stack deploy --orchestrator=kubernetes -c docker-compose.yml dundasbi

The result is 4 pods running:

The kubectl get pods command after deployment.
The kubectl get pods command after deployment.

6. See also

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours:
Phone: 9am-6pm, ET, Mon-Fri
Email: 7am-6pm, ET, Mon-Fri