Docker

You are here:
< Back

TIP

Prerequisites to be installed:

Introduction

Docker is the de facto industry standard for packaging applications into a container. By doing so, all dependencies, such as the language runtimes, operating system, and libraries are combined with the product.

Different cloud providers offer specific products to host your Docker containers, such as:

Orchestrators with Docker as a first class citizen:

Qredit Core provides Dockerfiles to ease development. We recommend you build the containers yourself as a security precaution.

Containerize the Persistent Store

Run a PostgreSQL container while using NodeJS from your local environment.

This configuration is well suited when you are not developing Qredit Core, but instead working with the API. By tearing down the PostgreSQL container, you reset the Nodes blockchain.

WARNING

The PostgreSQL main port is mapped to your host’s default Postgresql port, so you should not have PostgreSQL installed locally.

cd docker/development
docker-compose up

To run the containers in the background:

docker-compose up -d

In case you need to start with a clean Database:

docker-compose down -v
docker-compose up -d

Serve Qredit Core as a collection of Containers

Run a PostgreSQL container, build and run Qredit-Core using a mounted volume.

When a container is built, all files are copied inside the container. It cannot interact with the host’s filesystem unless a directory is specifically mounted during container start. This configuration works well when developing Qredit Core itself, as you do not need to rebuild the container to test your changes.

TIP

Along with PostgreSQL container, now you also have a NodeJS container which mounts your local qredit-core git folder inside the container and installs all NPM prerequisites.

cd docker/$NETWORK      # (NETWORK = testnet || devnet)
docker-compose up -d

You can now enter your qredit-core container and use NodeJS in a Docker container (Linux environment).

docker exec -it core-$NETWORK-core bash

Need to start everything from scratch and make sure there are no remaining cached containers, images or volumes left? Just use the purge_all.sh script.

WARNING

Current files/presets are not Production ready. Official Production Qredit-Core Docker images will be released soon after Qredit-Core v2 goes live.

Last Updated On January 25, 2019