-
Notifications
You must be signed in to change notification settings - Fork 142
Deploy on Heroku
Geremia Taglialatela edited this page Jan 22, 2022
·
50 revisions
A fast guide on how to deploy icare on Heroku
Note: you will probably need to edit source code in order to customize icare according to your needs
- *nix based OS (we don't support Microsoft Windows)
- git version control system
- Heroku Toolbelt
- A working Auth0 Application
- A valid Google Maps JavaScript API key
Replace appname
with a name of your choice.
Start from step 2 if you have already cloned the application
-
Clone the repo, switch to the repo folder, bundle
git clone https://github.com/diowa/icare.git cd icare bundle
-
Setup a new application
heroku create appname --remote production
-
Set buildpacks
heroku buildpacks:set https://github.com/diowa/heroku-buildpack-vendorbinaries.git heroku buildpacks:add heroku/nodejs heroku/ruby
-
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
- 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)"
- 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
- Push!
git checkout main
git push production main
- Create db indexes and populate db with some default objects
heroku run rails db:schema:load db:seed