100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Added quickstart documentation and config
Christian Bauerd10742143ce2
diff --git a/README.md b/README.mdindex 936edcacb..1b3ffefa0 100644--- a/README.md+++ b/README.md@@ -1,18 +1,33 @@-# OpenRemote+<div style="color: #c1d72f; font-size: 150%">+ OpenRemote+</div>+<div style="color: #000000; font-weight: bold; font-size: 110%;">+IoT Management Simplified+</div>++---* **Live Demo**: http://demo2.openremote.com (test/test)+* **Docker Images**: https://hub.docker.com/u/openremote/* **Documentation/Wiki:** https://github.com/openremote/openremote/wiki* **Community:** https://groups.google.com/forum/#!forum/openremotecommunity* **Issues:** https://github.com/openremote/openremote/issues-## Development+## Quickstart-### Preparing the environment+You'll need a Docker host to run this software.++1. Install [Docker Toolbox](https://www.docker.com/products/overview#/docker_toolbox)+1. Start Kitematic and open the *Docker CLI*+1. Get the IP of your Docker host VM with: `docker-machine ip default`+1. Download [docker-compose-demo.yml](https://raw.githubusercontent.com/openremote/openremote/master/docker-compose-quickstart.yml)+1. Edit this file and review the settings+1. Deploy the whole stack with: `docker-compose -f docker-compose-demo.yml [up|down]`+1. Open http://DOCKER_HOST_IP:MAPPED_PUBLIC_PORT in your browser-You'll need a Docker host to work on this project.+## Development-* Install Docker Toolbox: https://www.docker.com/products/overview#/docker_toolbox-* Start Kitematic and open the *Docker CLI*. The environment variable `DOCKER_HOST` should be set and you should be able to execute `docker images`, `docker ps` and any other Docker client command.+### Preparing the environmentAll Docker and Gradle commands should be executed in the project root directory.@@ -30,9 +45,7 @@ Test and sample data will be installed fresh every time you start the server(s).All services required for development can be deployed with Docker Compose, configured in `docker-compose.yml`. Execute `docker-compose up` in the project root to download required images (this might take a while and give no feedback) and run containers.-When startup completes, get the IP of your Docker host VM with `docker-machine ip default`.--The default configuration of all `*Service` classes is for host IP `192.168.99.100`. If this is not your Docker host IP, you must set various environment variables. (TODO documentation)+The default configuration of all `*Service` classes is for host IP `192.168.99.100`. If this is not your Docker host IP, you must set various environment variables (see [Quickstart](https://raw.githubusercontent.com/openremote/openremote/master/docker-compose-quickstart.yml)).### Run GWT code server@@ -65,10 +78,11 @@ You can extract smaller tilesets with the following procedure:1. Extract the region with:`tilelive-copy --minzoom=0 --maxzoom=14 --bounds="BOUNDARY BOX COORDINATES" theworld.mbtiles myextract.mbtiles`-## Update demo server+## Production++### Publishing images-First build Docker images with `./gradlew buildImage`, you might want to `clean` before.-The configuration in `docker-compose-demo.yml` is prepared for our demo server deployment. You will have to change the `IDENTITY_NETWORK_HOST` and `IDENTITY_NETWORK_WEBSERVER_PORT` variables to the externally (by users) reachable hostname and port of your stack.+Build Docker images with `./gradlew buildImage`, you might want to `clean` before.-Deploy the whole stack with `docker-compose -f docker-compose-demo.yml [up|down]`.\ No newline at end of file+You can also directly build and push the image to our (Docker Hub Account)[https://hub.docker.com/u/openremote/]: `/gradlew pushImage -PdockerHubUsername=username -PdockerHubPassword=secret`diff --git a/docker-compose-quickstart.yml b/docker-compose-quickstart.ymlnew file mode 100644index 000000000..799020f0c--- /dev/null+++ b/docker-compose-quickstart.yml@@ -0,0 +1,88 @@+version: '2'++# We have four services:+#+# - The Manager is the management frontend and main API gateway.+# - Keycloak is the identity provider, we use OAuth2 and bearer tokens for all API access.+# - MongoDB is the storage backend of Orion+# - Orion is the context broker, it holds the current state of all IoT assets and devices.+services:++ # Manager+ #+ # This is the API gateway for the whole system and hosting the public resources+ # of the manager web application.+ manager:++ # Use installed or pull the latest image from Docker Hub.+ image: openremote/manager:latest++ # This application exposes a public web service that should be mapped to a host+ # port. The default is '8080', this is the port on your Docker host to access+ # the application. The second '8080' must match the service-internal port (see below).+ ports:+ - "8080:8080"++ # This service needs access to other services on the Docker network.+ depends_on:+ - orion+ - keycloak++ environment:++ # It is important that all services have the same timezone and are time synchronized.+ # Bearer tokens are only valid for minutes, and authentication fails if Keycloak drifts.+ TZ: "Europe/Zurich"++ # If dev mode is enabled, caching and other performance-optimizations will be disabled.+ DEV_MODE: 'false'++ # If this is the first time you are starting this stack, and/or with non-persistent+ # context broker (the default), you might want to work with some automatically imported+ # sample data.+ IMPORT_SAMPLE_DATA: 'true'++ # The service-internal interface and port to listen on. This should not be changed.+ WEBSERVER_LISTEN_HOST: 0.0.0.0+ WEBSERVER_LISTEN_PORT: 8080++ # The public host name of this OpenRemote installation. This name is used in bearer tokens+ # and must be the name you access the web services under. If you are using Docker Toolbox,+ # this is the IP of a virtual machine running the Linux Docker host (see VirtualBox).+ IDENTITY_NETWORK_HOST: '192.168.99.100'++ # The public port of this OpenRemote installation. For simple installations without an+ # HTTP proxy in front of this application, this will be the public webservice host-mapped+ # port.+ IDENTITY_NETWORK_WEBSERVER_PORT: 8080++ # The service-internal host name and port of the context broker, configured automatically.+ CONTEXTBROKER_HOST: orion+ CONTEXTBROKER_PORT: 1026++ # The service-internal host name and port of the identity provider, configured automatically.+ KEYCLOAK_HOST: keycloak+ KEYCLOAK_PORT: 8080++ keycloak:+ image: openremote/keycloak:latest+ environment:+ TZ: "Europe/Zurich"+ KEYCLOAK_USER: admin++ # Change the admin root passwort if you make this application publicly accessible! Note+ # that imported sample data also creates a 'test' user with password 'test'. This should+ # not be imported in production.+ KEYCLOAK_PASSWORD: admin+ mongo:+ image: mongo:2.6+ command: --smallfiles+ environment:+ TZ: "Europe/Zurich"+ orion:+ image: fiware/orion:0.28+ links:+ - mongo+ command: -dbhost mongo+ environment:+ TZ: "Europe/Zurich"diff --git a/docker-compose.yml b/docker-compose.ymlindex 5d74b5459..44514d77f 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -1,7 +1,7 @@version: '2'services:- keycloak:+ keycloak_dev:build:context: ./keycloakdockerfile: Dockerfile-dev@@ -14,17 +14,17 @@ services:KEYCLOAK_LOGLEVEL: DEBUGports:- "8081:8080"- mongo:+ mongo_dev:image: mongo:2.6command: --smallfilesenvironment:TZ: "Europe/Zurich"- orion:+ orion_dev:image: fiware/orion:0.28links:- - mongo+ - mongo_devports:- "8082:1026"- command: -dbhost mongo+ command: -dbhost mongo_devenvironment:TZ: "Europe/Zurich"diff --git a/gradle.properties b/gradle.propertiesindex 50f6f5945..8a9e84066 100644--- a/gradle.properties+++ b/gradle.properties@@ -4,7 +4,7 @@ dockerRepository = openremotegwtGradlePluginVersion = 0.6aptGradlePluginVersion = 0.4-dockerGradlePluginVersion = 2.6.6+dockerGradlePluginVersion = 2.6.8slf4jVersion = 1.7.10rxjavaVersion = 1.1.1