diff --git a/riemann-dash/Dockerfile b/riemann-dash/Dockerfile new file mode 100644 index 0000000..0ebd8a0 --- /dev/null +++ b/riemann-dash/Dockerfile @@ -0,0 +1,18 @@ +FROM rlister/ruby:2.1.5 + +MAINTAINER Ric Lister, rlister@gmail.com + +RUN DEBIAN_FRONTEND=noninteractive \ + apt-get update && \ + apt-get install -y \ + ca-certificates + +RUN gem install --no-rdoc --no-ri riemann-dash thin fog + +WORKDIR /app + +ADD config.rb /app/ + +EXPOSE 4567 + +CMD [ "riemann-dash" ] diff --git a/riemann-dash/README.md b/riemann-dash/README.md new file mode 100644 index 0000000..5c1546d --- /dev/null +++ b/riemann-dash/README.md @@ -0,0 +1,22 @@ +# Riemann-Dash + +[Riemann-Dash](https://github.com/aphyr/riemann-dash) is a +javascript, websockets-powered dashboard for +[Riemann](http://riemann.io/). + +This dockerfile builds an S3-enabled image that can be configured +using environment variables. UI-configured dashboard settings can be +persisted in S3 and read by multiple riemann-dash containers. + +This image also uses `thin` rather than `WEBrick`. + +## Usage + +``` +docker run -it --name riemann-dash \ + -e WS_CONFIG=s3://my-bucket/config.json \ + -e AWS_ACCESS_KEY_ID=AECH8AEBUO0SHE7OOW9R \ + -e AWS_SECRET_ACCESS_KEY=OU0BA6AEZU2EID4SHOHZ2FEITIL4UGOHXIU7AEX1 \ + -p 4567:4567 \ + rlister/riemann-dash +``` diff --git a/riemann-dash/config.rb b/riemann-dash/config.rb new file mode 100644 index 0000000..b248a6f --- /dev/null +++ b/riemann-dash/config.rb @@ -0,0 +1,37 @@ +# Example configuration file for riemann-dash. + +# Serve HTTP traffic on this port +set :port, ENV.fetch('PORT', 4567) + +# Answer queries sent to this IP address +set :bind, ENV.fetch('BIND', '0.0.0.0') + +if ENV['RIEMANN_BASE'] + riemann_base = ENV['RIEMANN_BASE'] + riemann_src = "#{riemann_base}/lib/riemann/dash" + + # Add custom controllers in controller/ + config.store[:controllers] = ["#{riemann_src}/controller"] + + # Use the local view directory instead of the default + config.store[:views] = "#{riemann_src}/views" + + # Specify a custom path to your workspace config.json + config.store[:ws_config] = "#{riemann_base}/config/config.json" + + # Serve static files from this directory + config.store[:public] = "#{riemann_src}/public" +end + +# Save workspace configuration to Amazon S3 (you'll need to have the "fog" +# gem installed) +if ENV['WS_CONFIG'] + config.store[:ws_config] = ENV['WS_CONFIG'] ## eg 's3://my-bucket/config.json' +end + +if ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY'] + config.store[:s3_config] = { + aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'], + aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'] + } +end