Rebar Hub Docker Deployment

Monkton, Inc.

Monkton supports deploying the Rebar Hub in Docker Containers, enabling rapid deployment within an accreddited environment.

The Rebar Hub is deployed as two separate containers. One is the Rebar Admin Console, which provides the administrative interfaces for Rebar. The other is the Rebar API Services, the lightweight services that enable apps to interact with Rebar.

Configuring Rebar Settings

The core operation of Rebar is configured through a series of Environment Variables. These configure certain low level services within the Rebar Admin and Rebar API services. They will instruct Rebar to interact with certain database services, push services, etc.

The specific configuration of these environment variables can be found here.

Rebar Reverse Proxy

We have configured Rebar to deploy the Admin services on the 5959 port and the API services to run on the 5858 port. These can be configured via the environment variable REBAR_DOCKER_URLS. This will tell the Rebar Hub to leverage those URL ports to listen on. The difference in the ports enables the containers to run on the same Docker instance.

With this, a NGinx or other proxy can be configured to accept TLS traffic into port 443 and redirect to the desired 5858 or 5959 ports, all on the same Docker instance.

Launching Rebar Docker Instances

To deploy the Rebar Docker instances, we will deploy them on their own Docker network. Depending on how you are deploying Rebar, you may need to deploy your own instance of Redis. If you are deploying into PaaS, we highly recommend using managed Redis services.

Docker Tags

Monkton tags our Docker instances with the following tags. The root instance is always rebar with the applicable admin-latest or api-latest tags. Tags are versions, for instance we may have the admin-1.4.100 tag. Additionally, we have an alpha and beta tag scheme: admin-alpha-latest and admin-beta-latest are examples of the Admin container alpha and beta tags.

To pull the lasest Admin container, run the following command:

docker pull monktoninc/rebar:admin-latest

To pull the lasest API container, run the following command:

docker pull monktoninc/rebar:api-latest

As another example, to pull the lasest beta API container, run the following command:

docker pull monktoninc/rebar:api-beta-latest

Creating the Network

The network can be customized, but we leverage a bridge driver:

docker network create --driver bridge rebar_isolated_network

Creating Redis database

The Redis Docker container should be deployed leveraging a data volume, we will skip that for demonstration purposes:

docker run -i -d --network=rebar_isolated_network --restart always --name rebar-redis -p 6379:6379 redis:5.0.3

Deploy the Rebar Admin Docker Instance

The Admin Docker instance will be deployed as follows:

docker run -i -d --network=rebar_isolated_network --restart always \
	-p 5858:5858 \
	-e ASPNETCORE_ENVIRONMENT='Development' \
	-e REBAR_AUDIT_CACHE_DURATION_SECONDS='3' \
	-e REBAR_AWS='false' \
	-e REBAR_CACHE_DURATION_SECONDS='60' \
	-e REBAR_CACHE_ENABLED='false' \
	-e REBAR_CONFIG_SOURCE='env' \
	-e REBAR_CORE_TYPE='ADMIN' \
	-e REBAR_DATABASE_KIND='redis' \
	-e REBAR_DISABLE_SSL='true' \
	-e REBAR_DOCKER_URLS='http://*:5858' \
	-e REBAR_REDIS_POSTFIX='' \
	-e REBAR_REDIS_PREFIX='rebar' \
	-e REBAR_REDIS_SERVER='rebar-redis:6379' \
	-e REBAR_REDIS_TYPE='local' \
	--name rebar-admin \
	monktoninc/rebar:admin-latest

Deploy the Rebar API Docker Instance

The API Docker instance will be deployed as follows:

docker run -i -d --network=rebar_isolated_network --restart always \
	-p 5959:5959 \
	-e ASPNETCORE_ENVIRONMENT='Development' \
	-e REBAR_AUDIT_CACHE_DURATION_SECONDS='3' \
	-e REBAR_AWS='false' \
	-e REBAR_CACHE_DURATION_SECONDS='10' \
	-e REBAR_CACHE_ENABLED='true' \
	-e REBAR_CONFIG_SOURCE='env' \
	-e REBAR_CORE_TYPE='API' \
	-e REBAR_DATABASE_KIND='redis' \
	-e REBAR_DISABLE_SSL='true' \
	-e REBAR_DOCKER_URLS='http://*:5959' \
	-e REBAR_REDIS_POSTFIX='' \
	-e REBAR_REDIS_PREFIX='rebar' \
	-e REBAR_REDIS_SERVER='rebar-redis:6379' \
	-e REBAR_REDIS_TYPE='local' \
	--name rebar \
	monktoninc/rebar:api-latest