Skip to content

Installation Manual - Docker Compose

Self Contained

This is the easiest way to run the containerized version of DQ0. All components and volumes are configured as docker instances defined in the docker-compose environment file.

Installation

  • Install Docker for your system: https://docs.docker.com/get-docker/
  • Obtain the DQ0 docker-compose file for the self contained version from your installation package.
  • Build the docker images with
docker-compose --env-file my.env build
  • Start the VMs with
docker-compose --env-file my.env up

Usage

When all docker instances are running, access the local web application from http://localhost:8080

Login with the provided credentials from your installation package.

Self Hosted

This version installs the database and volumes at your local system allowing for more control of the system state and users.

Installation

The local paths to the individual directories such as dq0-sdk, dq0-cli, dq0-platform and so on are mapped into the individual containers per volume. This ensures that the containers themselves can also access the HOST data and at the same time the directory structure of the HOSTS is retained.

It is important to note that your development environment requires editing of the environment values. Follow the preparation steps below.

Preperation

  • Copy docker-compose.env to a new file eg "my.env"
  • Change values inside your new local my.env file to fit your local system

Build

Now build the whole DQ0 with Docker Compose:

docker-compose --env-file my.env build

Before first use

If you have not used the dq0 components before you need to make some further preparation steps before starting dq0 with docker compose:

# inside dq0-cli
go run main.go --version

This will create a ".dq0" directory inside your user home directory like /path/to/user/home/.dq0. This directory contains your public key pair and additional information.

  • Create a new local database on your host machine
# inside dq0-platform
go run main.go db create

This will create a new 'sqlite.db' file inside the local dq0-platform directory. This file will be used to pass your host database to your current running docker instance of dq0-platform. Next we need to seed the database:

# inside dq0-platform
go run main.go db seed

Now we should have all 3 roles (admin owner, user) and all required action permissions created in the database. Last step is to add a user.

  • Register new user in dq0-platform. You need to add a new user (you) to dq0-platform:
# inside dq0-platform
go run main.go user add

Inputs to this command:

  • Role name: can be either admin, owner or user
  • Email: the email address you want to login in
  • Password: of your choice
  • User's device uuid: Here you need to copy from your DQ0 Home folder file: /path/to/user/home/.dq0/device and copy and paste the value of the "device_uuid" attribute.
  • User's base64 encoded public key: same here for "public_key". Ensure the copy and pasted string does not contain any whitespaces (empty string before or after)

Example:

Adding new user to database (user enabled by default):
Role name: admin
Email address: me@dq0.io
Password: 
User's device uuid: 78e1e9d4-cc8c-48da-a325-1c0f908cd9a5
User's base64 encoded public key: LS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tCk1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBcTNwUXFUWi9uTGNiRVViNVFyanYKZm1qU1lBeVdLRVZrMkIwT0FtR3pIYlF6VS9LSHNyUEJBYTZsYUdoUHQwWWdsaFdBVXBKWGp3NmEwY1JIL09FYwpOY0Nnb3NBMVJHdFV4Mzh4R2tQa29NZEd2K1JMNUpIc1hMUFRWZk8rZzVialY0QXo2dlNFWlJCVmJlYTJObnRXCm1ONXhPdkF0N1djY0Y0V3AvZFNyQWF2QjN6TGtNcVdZVDF4dnVxem5GQnVoQ0xwVkcyZURxblZaRkdaYmRhNXkKMXIvNTFHUmxRaTJUSFBpUkk1bHZicVhsRmFwbFBRNURpWDZpWEtvWEwzRG0yM0FMUG5yZGNMQWgrb3lxd2NwWQozTDMrTE5QNUlIQnlPZk15NGpoV3hVWlVxeUswc2JVTDRzeUxrSHlwS1Jmejd2d0pJd3llemxLekg3MG1xUTRxCmR3SURBUUFCCi0tLS0tRU5EIFJTQSBQVUJMSUMgS0VZLS0tLS0K

Normally, this process is done automatically during user registration. But as we are the very first user we have to do it like this. The added user will be directly "activated".

  • Add proxy and login

Now you should be able to start (using "start" section below). But we need to define the Proxy still. We can do this using the web application:

  • Start the VMs with docker-compose --env-file my.env up
  • Navigate your browser to the dashboard's settings view: http://localhost:8080/#/settings
  • Add New Proxy and enter following values:
    • Scheme: http
    • Hostname: localhost
    • Port: 8000
    • Request URI: (keep empty)

Usage

Now start all services defined in the docker compose file

docker-compose --env-file my.env up

Navigate to http://localhost:8080 and login with your credentials.