/lightstreamer/content.md

https://gitlab.com/apachipa/docs · Markdown · 125 lines · 79 code · 46 blank · 0 comment · 0 complexity · 43de1ce1184511b87755b7b88bab8241 MD5 · raw file

  1. # What is Lightstreamer Server?
  2. Lightstreamer is a real-time messaging server optimized for the Internet. Blending WebSockets, HTTP, and push notifications, it streams data to/from mobile, tablet, browser-based, desktop, and IoT applications.
  3. For more information and related downloads for Lightstreamer Server and other Lightstreaner products, please visit [www.lightstreamer.com](http://www.lightstreamer.com).
  4. %%LOGO%%
  5. # How to use this image
  6. ## Up and Running
  7. Launch the container with the default configuration:
  8. ```console
  9. $ docker run --name ls-server -d -p 80:8080 lightstreamer
  10. ```
  11. This will map port 8080 inside the container to port 80 on local host. Then point your browser to `http://localhost` and watch the Welcome page showing real time data flowing in from the locally deployed demo application, which is a first overview of the unique features offered by the Lightstreamer technology. More examples are available online at the [demo site](http://demos.lightstreamer.com).
  12. ## Custom settings
  13. It is possibile to customize each aspect of the Lightstreamer instance running into the container. For example, a specific configuration file may be supplied as follows:
  14. ```console
  15. $ docker run --name ls-server -v /path/to/my-lightstreamer-conf.xml:/lightstreamer/conf/lightstreamer_conf.xml -d -p 80:8080 lightstreamer
  16. ```
  17. In the same way, you could provide a custom logging configuration, maybe in this case also specifying a dedicated volume to ensure both the persistence of log files and better performance of the container:
  18. ```console
  19. $ docker run --name ls-server -v /path/to/my-lightstreamer_log_conf.xml:/lightstreamer/conf/lightstreamer_log_conf.xml -v /path/to/logs:/lightstreamer/logs -d -p 80:8080 lightstreamer
  20. ```
  21. If you also change in your `my-lightstreamer_log_conf.xml` file the default logging path from `../logs` to `/path/to/dest/logs`:
  22. ```console
  23. $ docker run --name ls-server -v /path/to/my-lightstreamer_log_conf.xml:/lightstreamer/conf/lightstreamer_log_conf.xml -v /path/to/hosted/logs:/path/to/dest/logs -d -p 80:8080 lightstreamer
  24. ```
  25. Alternatively, the above tasks can be executed by deriving a new image through a `Dockerfile` as the following:
  26. ```dockerfile
  27. FROM lightstreamer
  28. # Please specify a COPY command only for the the required custom configuration file
  29. COPY my-lightstreamer_conf.xml /lightstreamer/conf/lightstreamer_conf.xml
  30. COPY my-lightstreamer_log.xml /lightstreamer/conf/lightstreamer_log_conf.xml
  31. ```
  32. where `my-lightstreamer_conf.xml` and `my-lightstreamer_log_conf.xml` are your custom configuration files, placed in the same directory as the Dockerfile. By simply running the command:
  33. ```console
  34. $ docker build -t my-lightstreamer
  35. ```
  36. the new image will be built along with the provided files. After that, launch the container:
  37. ```console
  38. $ docker run --name ls-server -d -p 80:8080 my-lightstreamer
  39. ```
  40. To get more detailed information on how to configure the Lightstreamer server, please see the inline documentation in the `lighstreamer_conf.xml` and `lighstreamer_log_conf.xml` files you can find under the `conf` folder of the installation directory.
  41. ## Deployment of Adapter Sets
  42. You might want to use this image even with any Adapter Set, either developed by yourself or provided by third parties.
  43. To accomplish such goal, you may use similar strategies to those illustrated above:
  44. ### Deployment of a single Adapter Set
  45. To deploy a single custom Adapter Set, the simplest way is to attach its files into the factory adapters folder, as follows:
  46. ```console
  47. $ docker run --name ls-server -v /path/to/my-adapter-set:/lightstreamer/adapters/my-adapter-set -d -p 80:8080 lightstreamer
  48. ```
  49. ### Full replacement of the "adapters" folder
  50. In the case you have many custom Adapter Sets to deploy, a more appropriate strategy is to replace the factory adapters folder with the one located in your host machine:
  51. ```console
  52. $ docker run --name ls-server -v /path/to/my-adapters:/lightstreamer/adapters -d -p 80:8080 lightstreamer
  53. ```
  54. In this case, the `/path/to/my-adapters` folder has to be structured with the required layout for an adapters folder:
  55. ```console
  56. /path/to/my-adapaters+
  57. +my_adapter_set_1
  58. +my_adapter_set_2
  59. ...
  60. +my_adapter_set_N
  61. ```
  62. ### Building a new image
  63. Once again, a linear and clean approach is to make a new image including all needed files.
  64. In this case, you could write a simple Docker file in which the list of all your Adapter Sets configuration files is provided:
  65. ```dockerfile
  66. FROM lightstreamer
  67. # Will copy the contents of N Adapter Sets into the factory adapters folder
  68. COPY my-adapter-set-1 /lightstreamer/adapters/my-adapter-set-1
  69. COPY my-adapter-set-2 /lightstreamer/adapters/my-adapter-set-2
  70. COPY my-adapter-set-3 /lightstreamer/adapters/my-adapter-set-3
  71. ```
  72. Then, just build and start the container as already explained.
  73. ## Deployment of web server pages
  74. There might be some circumstances where you would like provide custom pages for the internal web server of the Lightstreamer Server. Even in this case, it is possible to customize the container by employing the same techniques as above.
  75. For example, with the following command you will be able to fully replace the factory `pages` folder:
  76. ```console
  77. $ docker run --name ls-server -v /path/to/custom/pages:/lightstreamer/pages -d -p 80:8080 lightstreamer
  78. ```
  79. where `/path/to/custom/pages` is the path in your host machine containing the replacing web content files.