Docker
  • 28 Aug 2024
  • 3 Minutes to read
  • PDF

Docker

  • PDF

Article summary

Docker is a platform that allows users to install and run N3uron within a container. A container is a lightweight, self-sufficient environment that includes all the necessary components of N3uron, such as the code, system tools, and settings.

The N3uron Docker image is available on DockerHub at the following link: https://hub.docker.com/r/n3uronhub/n3uron

Note:

This image does not contain the embedded MongoDB engine for Historian. Refer to the example below to launch N3uron with MongoDB.

Basic Usage

Launching a N3uron instance for testing

To launch an ephemeral N3uron instance for testing using the Docker CLI, run the following command :

docker run -it --name n3uron -e ADMIN_PASSWORD=n3uron -p 8003:8003 n3uronhub/n3uron:v1.21.10

The WebUI will now be accessible at http://localhost:8003. Log into the instance using the credentials provided as environment variables.

Launching a N3uron instance with data persistence

Step 1: Create Docker volumes to ensure data persistance:

docker volume create n3_config
docker volume create n3_data
docker volume create n3_licenses
docker volume create n3_log

Step 2: Run the container with the volumes mounted:

docker run -d \
    --name n3uron \
    --hostname docker-node01 \ # Hostname for licensing
    -e ADMIN_PASSWORD=n3uron \
    -e USER_PASSWORD=n3uron \
    -p 8003:8003 \ # HTTP WebUI
    -v n3_config:/opt/n3uron/config \
    -v n3_data:/opt/n3uron/data \
    -v n3_log:/opt/n3uron/log \
    -v n3_licenses:/opt/n3uron/licenses \
    n3uronhub/n3uron:v1.21.10

Step 3: Open http://localhost:8003 to access the WebUI and log into the platform using the credentials provided as environment variables.

Upgrading a N3uron container instance

To upgrade a running instance of N3uron follow the steps below:

Step 1 (Optional): Create a node backup to restore the N3uron configuration if something goes wrong during the update. You can find the steps to perform a node backup in the Backup and Restore section.

Step 2 (Recommended): Review the release notes for the target N3uron version to identify any breaking changes that might affect your current configuration.

Note:

It is strongly recommended to apply the update in a testing environment before implementing it in the production environment.

Step 3: Pull the desired version of N3uron from DockerHub:

docker pull n3uronhub/n3uron:vX.X.X

Step 4: Stop and remove the container (data will persist in the volumes). In this example, we assume the container is named “n3uron”:

docker stop n3uron
docker rm n3uron

Step 5: Run the command documented in the previous section to launch a new N3uron container with the desired version.

Step 6: Log into the WebUI to ensure everything is running correctly. If you encounter any issues during the upgrade, you can revert to the previous version of N3uron by following the same steps outlined in this section.

Standalone deployment with Historian

This example shows how to deploy a standalone N3uron instance with a MongoDB database to store historical data using Docker Compose.

Step 1: Create a 'compose.yaml' file with the following content:

services:
  n3uron:
    image: n3uronhub/n3uron:v1.21.10
    hostname: docker-node01 # Hostname for licensing
    environment:
     - ADMIN_PASSWORD=n3uron
     - USER_PASSWORD=n3uron
    ports:
     - 8003:8003 # HTTP WebUI
     - 8443:8443 # HTTPS WebUI
     - 3001:3001 # Inbound Links
    volumes:
      - config:/opt/n3uron/config
      - data:/opt/n3uron/data
      - licenses:/opt/n3uron/licenses
      - log:/opt/n3uron/log
    restart: always

  mongo:
    # MongoDB database for Historian, https://hub.docker.com/_/mongo
    image: mongo:7
    ports:
       - 27017:27017
    volumes:
      - mongo_data:/data/db
    restart: always

volumes:
  config:
  data:
  licenses:
  log:
  mongo_data:

Note:

Depending on the module instances in use, you may need to add additional ports to the example file above. For instance, Web Vision may require ports 8004 and 8444 to be included.

Step 2: Deploy the stack using the following command:

docker compose up -d

Step 3: Open http://localhost:8003 to access the WebUI and log into the platform using the credentials provided as environment variables.

Note:

When configuring the Historian instance, enter the name of the service in the Host field. In the example above, we used “mongo” as the name of the service.


Was this article helpful?