Skip to content

Docker Deployment

1.4

NF, when deployed using Docker (or other container runtimes) requires two containers: one running Normal Framework; and one running Redis.

Quick Start

The quickest way to get started is by using the docker-compose file provided as part of the SDK.

Networking

The Normal Framework container requires network_mode: host in order to be able to properly process BACnet traffic. This limits the ability to use other Docker networking primatives to isolate the container.

After installation, the API Gateway and Management console are exposed on port tcp/8080 if not using SSL or tcp:4443 if SSL is enabled.

Internal services in the container bind ports on localhost; due to the use of host networking, these may conflict with other services running on the computer. The ports in use are in the range 9090-10000 (raw gRPC services), and 2110-2120 (for Prometheus endpoints.) Although it is possible to connect to these services, they should not be used and instead you should connect to the API gateway.

Filesystem

"Hard state" is stored in Redis; which should be backed up. NF also requires a writeable, persistent volume for soft state; such as data which are being buffered before being sent out; low-level configuration settings, and other data which should persist across reboots.

This state is stored within /var/nf in the container; it is recommended to volume-mount this directory so that it persists across restarts.

For security, you may mount the container volume read-only. In this case, you must set S6_READ_ONLY_ROOT=1, and mount /run and /etc/nginx/conf.d/ as tmpfs mounts.

Initialization and Configuration

Within the container, NF uses s6-rc to start services and ensure they are restarted on error. You may inspect the s6 configuration by looking in /etc/s6-overlay; although detailed documentation is beyond the scope of this article, it is possible to alter the environment for individual services by adjusting the contents of this directory. Additionally, environment variables applied to the container (i.e., on the Docker command line) are passed to all services.

Redis

Normal Framworking includes a build of Redis Server which has been validated to work correctly. You may also build your own; there are no modifications. NF requires RediSearch and RedisTimeseries to be installed on the redis instance.

Redis stores its data in /data; this directory should be volume-mounted and backed up.