Docker deployment¶
The ResIOT team created a single, fully configurable image for ResIOT LoRaWAN Network Server & IoT Platform, the name is resiot/resiot:1000020¶
note 1: at each reboot the resiot/resiot:1000020 image proceeds with automatic updating to the latest version available
note 2: at the first start, wait a couple of minutes to allow time to perform all the necessary configurations
Docker Example¶
for this example it is assumed that we have a postgres database installed, redis and mosquitto mqtt at 172.17.0.1 ip address
sudo mkdir -p /opt/resiot00001
sudo nano /opt/resiot00001/config.json
Contents of file config.json:
{
"RESIOT_DB_TYPE": "postgres",
"RESIOT_DB_URL": "postgres://resiotdb:[yourpwd]@172.17.0.1:5432/resiotcore?sslmode=disable",
"RESIOT_REDIS_URL": "redis://172.17.0.1:6379",
"RESIOT_MQTT_URL": "tcp://172.17.0.1:1883",
"RESIOT_MQTT_USER": "",
"RESIOT_MQTT_PWD": "",
"RESIOT_MQTT_CACERT": "",
"RESIOT_LORA_BAND": "EU_863_870",
"RESIOT_LORA_NETID": "A0A1A2"
}
sudo docker pull resiot/resiot:1000020
sudo docker run -d --name resiot00001 -v /opt/resiot00001/updfld00001:/run -v /opt/resiot00001/data00001:/data -v /opt/resiot00001/config.json:/cfg/config.json -p 58088:8088 -p 58095:8095 -p 57677:7677/udp resiot/resiot:1000020
Web browser to: http://localhost:58088 for viewing ResIOT
Other commands
to set always restart even on reboot system
sudo docker update --restart always resiot00001
to kill container:
sudo docker kill resiot00001
to remove container:
sudo docker container rm resiot00001
to kill and remove container:
sudo docker kill resiot00001 ; sudo docker container rm resiot00001
to exec a command inside container (ex: ps aux):
sudo docker exec -it resiot00001 ps aux
to view container logs:
sudo docker logs -f resiot00001
sudo docker logs -f --until=2s resiot00001