Skip to content
Geremia Taglialatela edited this page Jan 22, 2022 · 50 revisions

A fast guide on how to deploy icare on Heroku

The Easy Way™

Deploy

Note: you will probably need to edit source code in order to customize icare according to your needs

The Hard Way™

Prerequisites

  1. *nix based OS (we don't support Microsoft Windows)
  2. git version control system
  3. Heroku Toolbelt
  4. A working Auth0 Application
  5. A valid Google Maps JavaScript API key

Instructions

Replace appname with a name of your choice.

Start from step 2 if you have already cloned the application

  1. Clone the repo, switch to the repo folder, bundle

    git clone https://github.com/diowa/icare.git
    cd icare
    bundle
    
  2. Setup a new application

heroku create appname --remote production
  1. Set buildpacks

    heroku buildpacks:set https://github.com/diowa/heroku-buildpack-vendorbinaries.git
    heroku buildpacks:add heroku/nodejs
    heroku/ruby
    
  2. Add add-ons

heroku addons:create heroku-postgresql:hobby-dev # Database
heroku addons:create redistogo:nano # Background jobs
heroku addons:create newrelic # App monitoring
heroku addons:create papertrail # Log monitoring
  1. Setup environment variables
heroku config:add APP_BASE_URL=CHANGEME_WITH_YOUR_APPNAME.herokuapp.com
heroku config:add AUTH0_CLIENT_ID=CHANGEME_WITH_YOUR_AUTH0_CLIENT_ID
heroku config:add AUTH0_CLIENT_SECRET=CHANGEME_WITH_YOUR_AUTH0_CLIENT_SECRET
heroku config:add AUTH0_DOMAIN=CHANGEME_WITH_YOUR_AUTH0_DOMAIN
heroku config:add DEVISE_PEPPER="$(bundle exec rake secret)" DEVISE_SECRET_KEY="$(bundle exec rake secret)"
heroku config:add GOOGLE_MAPS_API_KEY=CHANGEME_WITH_YOUR_GOOGLE_MAPS_API_KEY
heroku config:add RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=1.3
heroku config:add SECRET_KEY_BASE="$(bundle exec rake secret)"
  1. Setup Google Analytics, Airbrake and New Relic (optional)
heroku config:add GOOGLE_ANALYTICS_ID=UA-XXXXXXXX-X

heroku config:add AIRBRAKE_API_KEY=xxx
heroku config:add AIRBRAKE_HOST=xxx
  1. Push!
git checkout main
git push production main
  1. Create db indexes and populate db with some default objects
heroku run rails db:schema:load db:seed

References