Installation on Docker

Last updated: November 6th 2018

Prerequisites

The ReDBox stack can be run using Docker containers. There are images published on Docker Hub for all the required components in the stack:

As well as some optional components:

This installation guide uses the Docker Compose tool. For instructions on how to install docker-compose are available from Docker

Installation

  1. Set up a Compose file (docker-compose.yml). Here's an example but you may wish to customise parts of it to your needs including mounting volumes (See the reference for more information)

Note: copying the example below won't preserve indentation as required, if you'd like to copy it please use the version here

version: '3.1'
networks:
    main:
services:
    redboxportal:
        image: 'qcifengineering/redbox-portal:latest'
        ports:
            - '80:80'
        restart: always
        expose:
            - '80'
        environment:
            - NODE_ENV=docker
            - PORT=80
            - sails_redbox__apiKey=xxxx-xxxx-xxxx
            - sails_record__baseUrl_redbox=http://redbox:9000/redbox
            - sails_appUrl=http://localhost
        networks:
            main:
                aliases: [rbportal]
        entrypoint: '/bin/bash -c "cd /opt/redbox-portal && node app.js"'
    redbox:
        image: 'qcifengineering/redbox:2.x'
        expose:
            - '9000'
        environment:
            - RB_API_KEY=xxxx-xxxx-xxxx
        networks:
            main:
                aliases: [redbox]
        ports:
            - '9000:9000'
    mongodb:
        image: 'mvertes/alpine-mongo:latest'
        networks:
            main:
                aliases: [mongodb]
        ports:
            - '27017:27017'

The environment variables sails_redbox__apiKey and RB_API_KEY should be set the same and is the API key the portal uses on API requests to storage.

If you are not running this on your local machine, set the sails_appUrl to the URL of the server it is running on.

  1. Once the docker-compose.yml has been created, you can bring up the stack by running docker-compose up. See the Docker Compose command-line reference for other options.