README > Heroku
This shows how to create and deploy to a Heroku instance.
This setup uses multiple buildpacks to individually build the Angular app and then the Rails app. It will install all front dependencies from the /client folder and build it into the ../public folder for rails using this buildpack. Then it will run the default ruby buildpack. Using this method prevent us from needing to add the public folder or any compiled frontend code to our repository.
- Install Heroku CLI
- Create new app:
heroku create <app-name>
- Configure to multiple buildpacks:
heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
- Set Heroku build environment:
heroku config:set NODE_ENV=production
- Set Heroku Rails environment:
heroku config:set RACK_ENV=production
- Set Email Account:
heroku config:set GMAIL_ACCOUNT=<my account>@gmail.com
- Set Email Password:
heroku config:set GMAIL_PASSWORD=<my account password>
- Set Heroku URL for email links:
heroku config:set URL=https://[app name].herokuapp.com
- Move to the repository's root directory
- Deploy to Heroku:
git push heroku master
- Update Heroky DB:
heroku run rake db:migrate
- Open web application:
heroku open
- Migrate DB:
heroku run rake db:migrate
- Drop entire database:
heroku pg:reset DATABASE_URL
- Rebuild / migrate db:
heroku run rake db:migrate