This guide explains how to use a file to load environment variables instead of using the command line. This allows you to version control your file for each environment (production, staging, dev, …​)

Load Environments Variables from File

Check the --env-file option that docker provides : docker

  • The --env-file=[ ] reads the required environment variables from a file.

  • Create a file similar to the oneĀ  HERE

Run the following command :

sudo docker run -i -d --name=restcomm -v /var/log/restcomm:/var/log/restcomm/ --env-file="/PATH/TO/FILE/restcomm_localenv_basic" -e RCBCONF_STATIC_ADDRESS="IP_OF_SERVER" -e RCBCONF_RESTCOMM_HOSTNAME="ADD_HOSTNAME" -e RCBCONF_LOG_LEVEL="INFO" -p 8080:8080 -p 8443:8443 -p 9990:9990 -p 5080:5080 -p 5081:5081 -p 5082:5082 -p 5083:5083 -p 5080:5080/udp -p 65000-65050:65000-65050/udp restcomm/restcomm:latest
  • For more Info on available configuration options HERE