how to run the images in standalone mode, ie out of home-assistant ? #5
-
See also on https://emoncms-docker.github.io/All the following run commands include the --rm option, so that the container will not persist after closing, it will be destroyed. These are just starting points to get familiar with the container approach... The most basic launch, with the default parameters coming from the Dockerfile (mosquitto log level fixed to error and emoncms log level fixed to 2) :
To have more verbosity in the emoncms and mosquitto logs :
For mosquitto, you can add more than one log level like that :
To disable feedwriter and go out of low-write mode :
Dont forget adjusting the image name to your needs, especially if you proceed to a local build |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 20 replies
-
But using docker compose is a smartest option than all those docker run commands docker compose is an orchestrator written in go. To install on linux : https://github.com/docker/compose It is an easy process as you just have to download a binary file for your OS/arch Then you have to create a compose.yaml file which look like that :
To run all that, a simple command :
This is nice, supposing you stop the orchestrator with Ctrl-C, the container stops. It will anyway be restarted when you will restart your computer, due to the restart policy A more convenient way is to use the -d option :
You won't see anymore the container log on the command line. To check it : At this stage, you do not achieve a consistent data persistancy. If for some reason, you recreate the container because a new image with new features is available, all monitoring data is lost. So let's create a folder named data on the host and start emoncms with a volume. The compose file has to be modified like that :
Adjust MYSQL_USER and MYSQL_PASSWORD to the custom values of your taste. Please note you can only do that at the creation of the mariadb database. For the MQTT broker, you can change the credentials values when you want :
|
Beta Was this translation helpful? Give feedback.
-
Hi, solved the restore problems... The export download I produced was uncompressed courtesy of Safari when I downloaded it. Re-doing the backup and downloading using chrome kept it as a .tar.gz and this worked as expected. Up and running now with the restore, but I see no EmonHub module. Any reason why this isn't visible as I still want to use it to retrieve from modbus? |
Beta Was this translation helpful? Give feedback.
-
To follow on, I see a few of the components are not in this emon installation compared to my emonpi. I recognise that not all are relevant, but is it possible for me to add in EmonHub, EmonHubConfig and DemandShaper? |
Beta Was this translation helpful? Give feedback.
@gadgetbazza : I just did a manual restore as you intend to do and it works
On the host machine, I have a
/data
folder belonging to the current userstart the container :
it will create the
/data/emoncms
folderopen a shell session in the folder where you have an emoncms tar.gz backup :
check the container id :