Fork me on GitHub

Herr Knedel/Great things with containers: KPI Dashboard

Created Mon, 21 Mar 2022 00:00:00 +0000 Modified Mon, 28 Mar 2022 18:08:08 +0000 Difficulty level: It may take a little longer

415 Words

Especially in the Corona era, with decentralized work, current information is in hot demand in all places. I myself have already set up countless information systems and would like to introduce a great software called Smashing.Speaker: https://smashing.github.io/Das Smashing project was originally developed under the name Dashing by the company Shopify for the presentation of business figures. But of course you can display not only business figures. Developers from all over the world have developed Smashing - tiles so called widgets for Gitlab, Jenkins, Bamboo, Jira etc., see:https://github.com/Smashing/smashing/wiki/Additional-WidgetsDoch how to work with it now?

Step 1: Create base image

First, I create a simple Docker image that already comes with Ruby and Dashing.

x
+
Terminal

$ mkdir dashing-project
$ cd dashing-project
$ mkdir dashboard
$ vim Dockerfile

This is the first content I write to the Dockerfile file:

From ubuntu:latest
 
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY dashboard/ /code/

RUN apt-get update && apt-get install -y ruby wget unzip ruby-dev build-essential tzdata nodejs && \
gem install smashing && \
apt-get clean

After that, I create the Docker image with this command:

x
+
Terminal

$ docker build -t my-dashboard:latest .

This is what it looks like for me:

Step 2: Create Dashboard

Now I can create a new dashboard with the following command:

x
+
Terminal

$ docker run -it -v /path/to/my/dashing-project:/code my-dashboard:latest smashing new dashboard

After that, the “dashboard” folder in the Dashing project should look like this: Very good! Now I have to update the Dockerfile again. The new content is this:

From ubuntu:latest
 
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 
COPY dashboard/ /code/
 
RUN apt-get update && apt-get install -y ruby wget unzip ruby-dev build-essential tzdata nodejs && \
gem install smashing && \
gem install bundler && \
apt-get clean
 
RUN cd /code/ && \
bundle
 
RUN chown -R www-data:www-data  /code/

USER www-data
WORKDIR /code/

EXPOSE 3030

CMD ["/usr/local/bin/bundle", "exec", "puma", "config.ru"]

In addition, the Gemfile file in the “dashboard” folder must also be adjusted:

source 'https://rubygems.org'

gem 'smashing'
gem 'puma'

I repeat the build command:

x
+
Terminal

$ docker build -t my-dashboard:latest .

Now I can launch my new dashboard for the first time and access it at http://localhost:9292.
x
+
Terminal

$ docker run -it -p 9292:9292 my-dashboard:latest

And this is how it looks: This is the basis for a good information system. You can customize all color, scripts and widgets.