├── lazy-start.sh ├── Dockerfile ├── config.rb ├── config.rb.tmpl └── README.md /lazy-start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | CURDIR=$(pwd) 4 | 5 | docker run -d \ 6 | -p 4567:4567 \ 7 | -e DATADIR=/vol \ 8 | -v ${CURDIR}:/vol \ 9 | include/docker-riemann-dash 10 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:latest 2 | MAINTAINER include 3 | 4 | ENV DOCKERIZE_VERSION "0.0.3" 5 | 6 | ADD https://github.com/jwilder/dockerize/releases/download/v${DOCKERIZE_VERSION}/dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz \ 7 | /dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz 8 | 9 | RUN tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz && \ 10 | rm dockerize-linux-amd64-v${DOCKERIZE_VERSION}.tar.gz && \ 11 | gem install thin fog && \ 12 | mkdir -p /app && \ 13 | cd /app && \ 14 | git clone git://github.com/aphyr/riemann-dash.git && \ 15 | cd riemann-dash && bundler 16 | 17 | WORKDIR /app/riemann-dash 18 | 19 | ADD config.rb.tmpl /app/riemann-dash/config.rb.tmpl 20 | 21 | ENTRYPOINT [ "dockerize", "-template", "/app/riemann-dash/config.rb.tmpl:/app/riemann-dash/config.rb"] 22 | 23 | CMD ["bin/riemann-dash", "config.rb"] 24 | -------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | # Example configuration file for riemann-dash. 2 | 3 | # Serve HTTP traffic on this port 4 | set :port, 4567 5 | 6 | # Answer queries sent to this IP address 7 | set :bind, "0.0.0.0" 8 | 9 | riemann_base = '.' 10 | riemann_src = "#{riemann_base}/lib/riemann/dash" 11 | 12 | # Add custom controllers in controller/ 13 | config.store[:controllers] = ["#{riemann_src}/controller"] 14 | 15 | # Use the local view directory instead of the default 16 | config.store[:views] = "#{riemann_src}/views" 17 | 18 | # Specify a custom path to your workspace config.json 19 | config.store[:ws_config] = "#{riemann_base}/config/config.json" 20 | 21 | # Serve static files from this directory 22 | config.store[:public] = "#{riemann_src}/public" 23 | 24 | # Save workspace configuration to Amazon S3 (you'll need to have the "fog" 25 | # gem installed) 26 | # config.store[:ws_config] = 's3://my-bucket/config.json' 27 | # config.store[:s3_config] = {:aws_access_key_id => "123ABC", :aws_secret_access_key => "789XYZ"} 28 | -------------------------------------------------------------------------------- /config.rb.tmpl: -------------------------------------------------------------------------------- 1 | # Example configuration file for riemann-dash. 2 | 3 | # Serve HTTP traffic on this port 4 | set :port, {{ if .Env.PORT }}{{ .Env.PORT }}{{else}}4567{{end}} 5 | 6 | # Answer queries sent to this IP address 7 | set :bind, "{{ if .Env.HOST }}{{ .Env.HOST}}{{else}}0.0.0.0{{end}}" 8 | 9 | riemann_base = '.' 10 | riemann_src = "#{riemann_base}/lib/riemann/dash" 11 | 12 | # Add custom controllers in controller/ 13 | config.store[:controllers] = ["#{riemann_src}/controller"] 14 | 15 | # Use the local view directory instead of the default 16 | config.store[:views] = "#{riemann_src}/views" 17 | 18 | # Specify a custom path to your workspace config.json 19 | config.store[:ws_config] = "{{ if .Env.DATADIR }}{{ .Env.DATADIR }}/config.json{{else}}#{riemann_base}/config/config.json{{end}}" 20 | 21 | # Serve static files from this directory 22 | config.store[:public] = "#{riemann_src}/public" 23 | 24 | # Save workspace configuration to Amazon S3 (you'll need to have the "fog" 25 | # gem installed) 26 | {{ if .Env.S3_BUCKET }} 27 | config.store[:provider] = 'AWS' 28 | config.store[:ws_config] = 's3://{{ .Env.S3_BUCKET }}/config.json' 29 | config.store[:s3_config] = {:region => {{ .Env.REGION }}, :aws_access_key_id => "{{ .Env.AWS_ACCESS_KEY_ID }}", :aws_secret_access_key => "{{ .Env.AWS_SECRET_ACCESS_KEY }}"} 30 | {{else}} 31 | # config.store[:provider] = 'AWS' 32 | # config.store[:ws_config] = 's3://my-bucket/config.json' 33 | # config.store[:s3_config] = {:region => {{ .Env.REGION }}, :aws_access_key_id => "123ABC", :aws_secret_access_key => "789XYZ"} 34 | {{end}} 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Riemann Dash HTTP dashboard 2 | 3 | This docker image runs the latest ```https://github.com/aphyr/riemann-dash``` release. 4 | I could use ```https://hub.docker.com/r/davidkelley/riemann-dash/``` but I don't like neither defaults in production and also changing example file in place. 5 | 6 | ## Clone 7 | 8 | ```git clone https://github.com/include/docker-riemann-dash.git``` 9 | 10 | ## Build 11 | 12 | ```docker build -t include/docker-riemann-dash docker-riemann-dash/.``` 13 | 14 | ## Running / Burning config file via dockerize 15 | 16 | ```docker run -d -e HOST= -e PORT= -p : include/docker-riemann-dash``` 17 | 18 | **Example** 19 | 20 | ```docker run -d -e HOST=0.0.0.0 -p 4567:4567 include/docker-riemann-dash``` 21 | 22 | Default ```HOST=0.0.0.0``` and ```PORT=4567``` will be used if you don't define them, but don't forget to bind docker to it. 23 | 24 | Or if you have any AWS S3 bucket where you can store your dashboards, just set your ```S3_BUCKET```, ```AWS_ACCESS_KEY_ID``` and ```AWS_SECRET_ACCESS_KEY``` environment variables. 25 | 26 | ```sh 27 | docker run -d -e HOST=0.0.0.0 \ 28 | -e PORT=8080 \ 29 | -p 8080:8080 \ 30 | -e S3_BUCKET=devops-configs \ 31 | -e AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}" \ 32 | -e AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}" \ 33 | include/docker-reimann-dash 34 | ``` 35 | 36 | Alternative to this you can use ```lazy-start.sh```to kickstart a riemann-dash with default values. This will also mount as a volume your current directory into ```/vol``` inside your container to save your dashboards. 37 | 38 | ```sh 39 | ./lazy-start.sh 40 | ``` 41 | 42 | ## Fun 43 | 44 | Point your browser to ```http://:8080```. Don't forget to change Riemann server address. 45 | --------------------------------------------------------------------------------