项目作者: liske

项目描述 :
Yet another docker image for Nightscout
高级语言: Dockerfile
项目地址: git://github.com/liske/cgm-remote-monitor-docker.git
创建时间: 2019-03-02T12:37:29Z
项目社区:https://github.com/liske/cgm-remote-monitor-docker

开源协议:

下载


cgm-remote-monitor-docker

About

This is yet another docker image for Nightscout. Unlike the other images this tries to:

  • use individual tags for each Nightscout release
  • use Docker Hub’s auto build feature
  • provide minimalized images using multistage builds
  • provide a docker-compose.yml example file
  • keep it up to date

Prerequisites

You need to have a host running Docker and Docker Compose. It is recommended to use a reverse proxy supporting https:// and wss:// SSL offloading.

Apache HTTPD reverse proxy

One possiblity is to use Apache HTTPD as SSL offloading reverse proxy using certificates from Let’s Encrypt.

You need to enable the mod_proxy and mod_proxy_wstunnel modules. Nightscout uses a Websocket connection which needs to be handled special using mod_rewrite:

  1. <VirtualHost *:443>
  2. ServerName ns.example.com
  3. RewriteEngine On
  4. RewriteCond %{REQUEST_URI} ^/socket.io [NC]
  5. RewriteCond %{QUERY_STRING} transport=websocket [NC]
  6. RewriteRule /(.*) ws://127.0.0.1:1337/$1 [P,L]
  7. ProxyPass / http://127.0.0.1:1337/
  8. ProxyPassReverse / http://127.0.0.1:1337/
  9. SSLCertificateFile /etc/letsencrypt/live/ns.example.com/fullchain.pem
  10. SSLCertificateKeyFile /etc/letsencrypt/live/ns.example.com/privkey.pem
  11. Include /etc/letsencrypt/options-ssl-apache.conf
  12. SetEnv AccessControlAllowOrigin https://ns.example.com
  13. # allow access by nightscout-reporter (@zreptil)
  14. #SetEnvIf Origin "https://nightscout-reporter.zreptil.de$" AccessControlAllowOrigin=$0
  15. Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
  16. Header set Access-Control-Allow-Credentials true
  17. </VirtualHost>

Deployment

Grab the example docker-compose.yml file and change it to meet your needs. You need to use an explicit version tag for the docker image - the latest tag is missing intentionally!

Details of the configuration parameters can be found in Nightscout’s README.md.

Upgrading

You need to check Nightscout Releases to look for changes. If a docker image of liske/cgm-remote-monitor with a new release tag is available you just need to update your docker-compose.yml file. Running docker-compose up again will restart Nightscout using the new image.