Docker

A Docker image is available at https://registry.hub.docker.com/r/sunforestsoftware/envisionscada

Updated 3 min read
On this page (2 sections)
  1. Overview
  2. HTTPS

Overview

A Docker image is available at https://registry.hub.docker.com/r/sunforestsoftware/envisionscada.

The image can be deployed on Windows and Linux hosts. Each tag holds an image for AMD64 (x86-64) and an image for 64-bit ARM (ARM64), and the pull selects the image that matches the architecture of the host, so the commands below are the same on both. Both images require a 64-bit operating system. The ARM64 image is available in the latest version. Python packages that contain compiled code are architecture specific, so on an ARM64 host the ARM64 build of such a package is installed (see the Install Python Libraries article).

The database and project related files are stored on a volume called EnvisionVolume and are automatically upgraded to the latest version when creating new containers. If the volume does not exist, it will automatically be created when using the run command below.

Pull the container from Docker Hub:
docker pull sunforestsoftware/envisionscada
To run the container
docker run -p 80:8080 --name=envisionscada --restart=always --mount source=EnvisionVolume,target=/EnvisionVolume sunforestsoftware/envisionscada:latest
To keep the certificates when the container is recreated, also mount a volume on /app/certs. It holds the OPC UA certificates (OPC UA Devices with Enable Secure Channel, OPC UA Server) in /app/certs/pki and the TLS certificates of MQTT Clients, MQTT Publishers, the MQTT Broker and Kafka Devices in /app/certs/tls:
docker run -p 80:8080 --name=envisionscada --restart=always --mount source=EnvisionVolume,target=/EnvisionVolume --mount source=EnvisionCerts,target=/app/certs sunforestsoftware/envisionscada:latest
If you wish to stop the container:
docker stop envisionscada
If you wish to delete the old container:
docker rm envisionscada
If you wish to delete the image
docker rmi envisionscada:latest
The System Metrics page shows which image is running: in Host and process, under EnvisionSCADA process, the Runtime row ends with X64 or Arm64. On a 64-bit ARM host, X64 means the container runs the AMD64 image through the emulation of the Docker host, which is considerably slower. Pull the tag again and recreate the container to run the ARM64 image.

HTTPS

The container serves HTTP on port 8080. It serves HTTPS on a second port when a server certificate is provided through the environment variables in the table below. This suits a plant network with its own certificate, for example a certificate created with the Certificate Generator and signed by the plant Certificate Authority (see the Certificates article). For a site that needs publicly trusted certificates that are renewed automatically, place a reverse proxy in front of the container instead.

The certificate is read from a folder on the host that is mounted in the container, so it is kept when the container is recreated. The certificate name (Common Name or a Subject Alternative Name) must match the IP address or DNS name the browsers use to open EnvisionSCADA, and the browsers must trust the Certificate Authority that signed it.

Environment variableDescriptionExample
ASPNETCORE_URLSPorts the container listens on. Add an https entry next to the http entry.https://+:8443;http://+:8080
ASPNETCORE_HTTPS_PORTHTTPS port on the host, used for the redirect from HTTP to HTTPS.443
ASPNETCORE_Kestrel__Certificates__Default__PathPath of the certificate in the container: a .pfx file (certificate and private key), or a .crt or .pem file used together with KeyPath./app/certs/https/cert.pfx
ASPNETCORE_Kestrel__Certificates__Default__PasswordPassword of the .pfx file, or of an encrypted private key file.
ASPNETCORE_Kestrel__Certificates__Default__KeyPathPath of the private key file (PEM) when Path is a .crt or .pem file./app/certs/https/cert.key
Run the container with HTTPS on port 443, using the cert.pfx file from the Certificate Generator placed in /opt/envision/https on the host:
docker run -p 80:8080 -p 443:8443 --name=envisionscada --restart=always --mount source=EnvisionVolume,target=/EnvisionVolume --mount source=EnvisionCerts,target=/app/certs -v /opt/envision/https:/app/certs/https:ro -e ASPNETCORE_URLS="https://+:8443;http://+:8080" -e ASPNETCORE_HTTPS_PORT=443 -e ASPNETCORE_Kestrel__Certificates__Default__Path=/app/certs/https/cert.pfx -e ASPNETCORE_Kestrel__Certificates__Default__Password=<certificate password> sunforestsoftware/envisionscada:latest
With a certificate and private key in PEM format, replace the certificate variables with:
-e ASPNETCORE_Kestrel__Certificates__Default__Path=/app/certs/https/cert.crt -e ASPNETCORE_Kestrel__Certificates__Default__KeyPath=/app/certs/https/cert.key

Once HTTPS is configured, a request on the HTTP port is redirected to the HTTPS port. Set ASPNETCORE_HTTPS_PORT to the HTTPS port on the host, so the redirect points to the port the browser can reach. A changed certificate is loaded when the container is restarted.

The container log shows the ports in use after a start, for example Now listening on: https://[::]:8443. If the certificate cannot be read, for example because of a wrong password, the container stops at start (with --restart=always it is restarted repeatedly) and the log names the reason. Read it with docker logs envisionscada.
Something missing or wrong in this article? Contact us