Updating and autostart
Updating the IIoT Platform to new image versions and configuring it to start automatically when the server boots.
After the platform is installed and running, use the steps below to update it to new image versions and to make it start automatically when the server boots.
Update the software
To update the software, stop the containers in
/opt/vadtelnewweb:bashdocker-compose downThen go to
/var/lib/unicloudand do the following.- Stop the
unicloudservice:
bashsudo service unicloud stop- Shut down the containers:
bashdocker-compose downCopy and unpack the new compressed image files:
bashgunzip vadtel-nginx-latest.tar.gz gunzip vadtel-app-latest.tar.gz gunzip anytelemetry-latest.tar.gz gunzip pgbouncer-latest.tar.gz gunzip vadteljsondaemon-latest.tar.gz gunzip logrotate-latest.tar.gz gunzip postgres-15.1-alpine.tar.gz gunzip redis-6.0.16-alpine.tar.gz gunzip vector-latest.tar.gzLoad the images into Docker:
bashdocker load -i vadtel-nginx-latest.tar docker load -i vadtel-app-latest.tar docker load -i anytelemetry-latest.tar docker load -i pgbouncer-latest.tar docker load -i vadteljsondaemon-latest.tar docker load -i logrotate-latest.tar docker load -i postgres-15.1-alpine.tar docker load -i redis-6.0.16-alpine.tar docker load -i vector-latest.tar.gzCheck that the images are available:
bashdocker imagesIf the images loaded without errors, run the following commands from the
/var/lib/unicloudfolder:shellsudo service unicloud start docker-compose up -dThen go to
/opt/vadtelnewweband start the application:shelldocker-compose up -dCheck the running containers:
bashdocker ps- Stop the
Configure autostart
Create, edit, or copy the
/etc/docker/daemon.jsonconfiguration file and add the following (adjust the values if necessary):daemon.json{ "log-driver": "json-file", "log-opts": { "max-size": "50m", "max-file": "3" } }Next, create an autostart script for the application. You need a
docker-compose-vadtel.servicefile with the contents below, whereWorkingDirectoryis the path todocker-compose.yml.Open the file:
shellnano /etc/systemd/system/docker-compose-vadtel.serviceAdd the following contents:
docker-compose-vadtel.service[Unit] Description=Docker Compose vadtel Application Service Requires=docker.service After=docker.service StartLimitIntervalSec=60 [Service] WorkingDirectory=/opt/vadtelnewweb ExecStart=/usr/bin/docker-compose up ExecStop=/usr/bin/docker-compose down TimeoutStartSec=0 Restart=on-failure StartLimitBurst=3 [Install] WantedBy=multi-user.targetTo enable the autostart script from
/etc/systemd/system/, run:shellsudo systemctl enable docker-compose-vadtel
Related topics
Was this page helpful?
Thanks for your feedback!