Open IoT is intended to be a flexible IoT backend and gateway management system, offering:
- easy and secure data ingestion
- device registry
- data flow management
- simple data transformations
- MQTT and HTTP transports
# Using Docker Compose
docker-compose up -d --build
# To build the frontend only once
npm run build
# To continuously watch for changes on the frontend
npm run watch
# To follow the logs of the backend
docker logs -f openiot_ui_1
# To run tests
npm test
# To run tests with coverage
npm run test:coverage
# To run tests with logger enabled
env TEST_LOGGER=true npm test
- Generate SSL certificates for your domain.
- Place the server private key in
server_key.pem
file - Place the certificate chain of the server certificate and the root certificate by inserting them one after another (in that order) in
server_certificate.pem
file. - Copy the two files in a psersistent directory on the docker host and create symlinks with the domain name (note that the names are important):
/certs/server_certificate.pem
/certs/iot.example.com.crt -> /certs/server_certificate.pem
/certs/server_key.pem
/certs/iot.example.com.key -> /certs/server_key.pem
- Copy
docker-compose-prod.yml
to your host asdocker-compose.yml
and update it by changing the following fields:
services.proxy.volumes[1] = /certs:/etc/nginx/certs/
services.broker.environment.RABBITMQ_ERLANG_COOKIE = cookie_secret
services.ui.environment.VIRTUAL_HOST = iot.example.com
services.ui.environment.DB_CONNECTION = mongodb://db/prod
services.ui.environment.ENCRYPTION_SECRET = encryption_secret
services.ui.environment.HANDLER_KEY = handler_key
services.ui.environment.HANDLER_SECRET = handler_secret
- (Optional) Add MongoDB service to composition. Don't forget to mount a persistent directories on the docker host as
/data/db
and/data/configdb
volumes in the Mongo container:
db:
image: mongo:latest
ports:
- 27017:27017
hostname: db
volumes:
- /path/to/mongodb/data/db:/data/db
- /path/to/mongodb/data/configdb:/data/configdb
- Run
docker-compose up -d
Create a redeploy.sh
script next to docker-compose.yml with the following contents:
#!/bin/bash
docker pull pvorotnikov/open-iot-proxy:latest
docker pull pvorotnikov/open-iot-broker:latest
docker pull pvorotnikov/open-iot-ui:latest
docker-compose up -d
Run it every time you need to update the service