Giter Club home page Giter Club logo

blazer-docker's Introduction

Blazer Docker

A Docker image for Blazer

Fork notes

This fork enables oracle support and adds ability to select time on start_time/end_time dropdown menus.

This because we have an oracle db storing data that has to be queried also specifiying time to reduce outputs.

Enabling oracle support

Uncomment these rows on Gemfile:

#gem "activerecord-oracle_enhanced-adapter", :require => false
#gem "ruby-oci8" # for oracle

Build using Dockerfile.oracle

docker build -f Dockerfile.oracle .

Disable time support on dropdown calendars (revert to default blazer behavior)

Remove

app/views/blazer/_variables.html.erb

Which is overriding the blazer's default

Getting Started

Pull the image

docker pull ankane/blazer

Create database tables

docker run -ti -e DATABASE_URL=postgres://user:password@hostname:5432/dbname ankane/blazer rails db:migrate

Run the web server

docker run -ti -e DATABASE_URL=postgres://user:password@hostname:5432/dbname -p 8080:8080 ankane/blazer

And visit http://localhost:8080

On Mac, use host.docker.internal instead of localhost to access the host machine (requires Docker 18.03+)

Authentication

Add basic authentication with:

-e BLAZER_USERNAME=admin -e BLAZER_PASSWORD=secret

Or use a reverse proxy like OAuth2 Proxy.

Checks

TODO: SMTP instructions

Schedule checks to run (with cron, Heroku Scheduler, etc). The default options are every 5 minutes, 1 hour, or 1 day, which you can customize. For each of these options, set up a task to run.

docker run ... rake blazer:run_checks SCHEDULE="5 minutes"
docker run ... rake blazer:run_checks SCHEDULE="1 hour"
docker run ... rake blazer:run_checks SCHEDULE="1 day"

You can also set up failing checks to be sent once a day (or whatever you prefer).

docker run ... rake blazer:send_failing_checks

For Slack notifications, create an incoming webhook and set:

-e BLAZER_SLACK_WEBHOOK_URL=https://hooks.slack.com/...

Name the webhook “Blazer” and add a cool icon.

Customization

Create a blazer.yml file with:

# see https://github.com/ankane/blazer for more info

data_sources:
  main:
    url: <%= ENV["DATABASE_URL"] %>

    # statement timeout, in seconds
    # none by default
    # timeout: 15

    # caching settings
    # can greatly improve speed
    # off by default
    # cache:
    #   mode: slow # or all
    #   expires_in: 60 # min
    #   slow_threshold: 15 # sec, only used in slow mode

    # wrap queries in a transaction for safety
    # not necessary if you use a read-only user
    # true by default
    # use_transaction: false

    smart_variables:
      # zone_id: "SELECT id, name FROM zones ORDER BY name ASC"
      # period: ["day", "week", "month"]
      # status: {0: "Active", 1: "Archived"}

    linked_columns:
      # user_id: "/admin/users/{value}"

    smart_columns:
      # user_id: "SELECT id, name FROM users WHERE id IN {value}"

# create audits
audit: true

# change the time zone
# time_zone: "Pacific Time (US & Canada)"

# email to send checks from
# from_email: [email protected]

# webhook for Slack
# slack_webhook_url: <%= ENV["BLAZER_SLACK_WEBHOOK_URL"] %>

check_schedules:
  - "1 day"
  - "1 hour"
  - "5 minutes"

# enable map
# mapbox_access_token: <%= ENV["MAPBOX_ACCESS_TOKEN"] %>

Create a Dockerfile with:

FROM ankane/blazer

COPY blazer.yml /app/config/blazer.yml

And build your image:

docker build -t my-blazer .

Deployment

Health Checks

Use the /health endpoint for health checks. Status code 200 indicates healthy.

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/blazer-docker.git
cd blazer-docker
docker build -t ankane/blazer:latest .

blazer-docker's People

Contributors

ankane avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.