Browse
 
Tools
Rss Categories

NLU Gateway Installation

Reference Number: AA-02440 Views: 3580 0 Rating/ Voters

The LumenVox NLU Gateway is supplied as a Docker container image.

Up-to-date installation information can be found in our public LumenVox Docker Hub repository


Getting Started

These instructions will cover usage information for this docker container.

Prerequisites

In order to run this container, you'll need Docker installed.

  • Windows
  • OSX
  • Linux

Quick Start

The quickest way to get the NLU Gateway server running is by running the following commands:

docker pull lumenvox/nlugatewayservice:latest
docker run -d -p 4443:4443 --restart always --name NluGateway lumenvox/nlugatewayservice:latest 

This will have the NLU gateway running as a single container service exposing port 4443.

At this point, it is now ready for NLU services to be added via the LumenVox Dashboard.

For more information on this please visit our NLU Gateway Administration article.

Advanced Start

The NLU Gateway container is designed to run as either a single stand-alone service or as part of a distributed architecture. It does this by storing the service configurations in a database with all API keys encrypted. By default, the container is set up to run as a standalone service using a local SQLite database and on container encryption keys. This standalone service can be started as follows:

docker run -d -p 4443:4443 --restart always --name NluGateway lumenvox/nlugatewayservice:latest

When running with more than one NLU Gateway Service and in order to synchronize service configurations, the same database and encryption keys must be used for all containers. To set this up the following must be accomplished:

  • Setting up a shared database , the database parameters must be given to each NLU Gateway container via environment variables.
  • Share encryption keys , the location /app/Keys/ within the docker file structure must be set up as a shared volume.
  • Mark all containers , except for one, as not the primary service (this is done via setting the PrimaryService environment variable to false).

Here is an example of starting the Primary service:

docker run -d -p 4443:4443 --env  ConnectionStrings__NLUServiceContext=<Your connection string here> --env  DatabaseProvider=<Database Provider> -v  /sharedLoaction/Keys:/app/Keys/ lumenvox/nlugatewayservice:latest

This example shows how to start Secondary or following services:

docker run -d -p 4443:4443 --env  ConnectionStrings__NLUServiceContext=<Your connection string here> --env  DatabaseProvider=<Database Provider> --env  PrimaryService=false -v  /sharedLoaction/Keys:/app/Keys/ lumenvox/nlugatewayservice:latest

Using docker-compose file to manage your configuration is often easier than specifying the parameters as shown above. Here is an example docker-compose.yml with two NLU Gateway services working together using a Postgres database.

version: '3.4'

services:
        nlugatewayservice:
                container_name: nlu-gateway-service
                image: lumenvox/nlugatewayservice:latest
                ports:
                        - '4443:4443'
                environment:
                        - ConnectionStrings__NLUServiceContext=Host=nlu-gateway-db;Database=postgres;Username=postgres;Password=xxx_POSTGRES_PASSWORD_HERE_xxx
                        - DatabaseProvider=PostgreSQL
                depends_on:
                        - nlu-gateway-db
                networks:
                        - nlu-gateway-network
                volumes:
                        - './Keys:/app/Keys/'
        nlugatewayservice2:
                container_name: nlu-gateway-service2
                image: lumenvox/nlugatewayservice:latest
                ports:
                        - '4444:4443'
                environment:
                        - ConnectionStrings__NLUServiceContext=Host=nlu-gateway-db;Database=postgres;Username=postgres;Password=xxx_POSTGRES_PASSWORD_HERE_xxx
                        - DatabaseProvider=PostgreSQL
                        - PrimaryService=false
                depends_on:
                        - nlu-gateway-db
                        - nlugatewayservice
                networks:
                        - nlu-gateway-network
                volumes:
                        - './Keys:/app/Keys/'

        nlu-gateway-db:
                ports:
                        - '5432:5432'
                container_name: nlu-gateway-db
                environment:
                        - POSTGRES_PASSWORD=xxx_POSTGRES_PASSWORD_HERE_xxx
                volumes:
                        - 'postgres-db-vol:/var/lib/postgresql/data'
                image: 'postgres:12.3'
                networks:
                        - nlu-gateway-network

volumes:
        postgres-db-vol:
        Keys:

networks:
        nlu-gateway-network:
                driver: bridge


Environment Variables

The following are available environment variables that may be set:

  • ConnectionStrings__NLUServiceContext


    The connection string of the database used to store NLU service information. (e.g. "Host=nlu-gateway-db;Database=postgres;Username=postgres;Password=xxx_POSTGRES_PASSWORD_HERE_xxx").
    This connection string format will vary depending on which database provider is selected. (unset by default)

  • DatabaseProvider


    The database provider of the database to use.
    This may be either "postgresql", "sqlite", "sqlserver", or "mysql". (default value is "sqlite")

  • PrimaryService


    A marker to tell if the service is the main service and whether or not it should handle the creation of encryption keys.
    Only one service sharing encryption keys should have this set to true.
    (default value is true)

  • Kestrel__Certificates__Default__Path


    The HTTPS certificate used to protect communications between the NLU Gateway and other LumenVox services.
    This certificate must be signed by an internal LumenVox CA Certificate.
    For more information on this please contact LumenVox Support.

  • Kestrel__Certificates__Default__Password


    The HTTPS certificate password is used to protect communications between the NLU Gateway and other LumenVox services.
    This certificate must be signed by an internal LumenVox CA Certificate.
    For more information on this please contact LumenVox Support.

  • DataProtection__Certificate__Path


    The HTTPS certificate used to protect encryption keys which are used to encrypt and decrypt API keys.

  • DataProtection__Certificate__Password


    The HTTPS certificate password used to protect encryption keys which are used to encrypt and decrypt API keys.

  • UnProtectCertificates__Certificate__Path__01


    An additional HTTPS certificate used only to decrypt encryption keys which are used to encrypt and decrypt API keys.
    This certificate will be used to attempt to decrypt the API key if the primary certificate fails.
    To add additional certificates, use the same environment variable but increment the final integer for each additional certificate.

  • UnProtectCertificates__Certificate__Path__01


    The password for the additional HTTPS certificate used only to decrypt encryption keys which are used to encrypt and decrypt API keys.
    To add additional certificates, use the same environment variable but increment the final integer for each additional certificate.

Volumes

  • /app/Keys/


    Location where keys for the encryption of API keys is store.

    Note:

    This location must be shared across all instances of the NLU Gateway