Managing .env files


Overview

CAST Imaging uses .env files (a simple text file used to store environment variables that can be automatically loaded by Docker Compose or other Docker related tools) to set specific options and parameters that are required by each CAST component and their containers.

Some (not all) of these options and parameters are exposed in the installation configuration file called configuration.conf and are therefore configurable BEFORE an installation is actioned (during the installation process, the values in configuration.conf are transferred to the appropriate .env file). In most situations it should not be necessary to customize the .env post-installation, however, if a change is required, follow the instructions below.

How can I customize a CAST Imaging .env file?

There is one .env file for each component installed as part of a CAST Imaging application stack. Customization should only be applied post-installation. The files will be located in the following folders:

/opt/cast/installation/imaging-dashboards/.env
/opt/cast/installation/imaging-node/.env
/opt/cast/installation/imaging-services/.env
/opt/cast/installation/imaging-viewer/.env

To make a change, edit the file, update the required option or parameter and then start and stop the relevant containers using docker compose, for example to make changes to the imaging-viewer component:

$ cd /opt/cast/installation/imaging-viewer    # navigate to the required installation folder    
$ sudo nano .env                              # make any required changes
$ sudo docker compose down                    # stop the containers
$ sudo docker compose up -d                   # start the containers in detached mode
$ sudo docker ps                              # check containers are running