Rails + React + Redux - Pt 10
I'm nearly ready to make the DRAGnet backend accessible while I continue work on the frontend. I decided to run with Heroku, largely because I found their documentation to be so good. The setup was really simple so I've tested it and pulled it back down while I put together some documentation.
Let's get started!
I had already installed the Heroku CLI onto my machine for a previous project- it was easy breezy.
heroku login
Because I had previously stuck with the 'sqlite3' gem when creating the Rails project, I needed to switch to 'pg' in the gemfile.
bundle install
With the database gem change I needed to update the config/database.yml file.
# PostgreSQL version 12.1 | |
# gem install pg | |
# | |
# Ensure the PostgreSQL gem is defined in your Gemfile | |
# gem 'pg' | |
# | |
default: &default | |
adapter: postgresql | |
encoding: unicode | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
timeout: 5000 | |
development: | |
<<: *default | |
database: dragnet_development | |
# Warning: The database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". | |
# Do not set this db to the same as development or production. | |
test: | |
<<: *default | |
database: dragnet_test | |
production: | |
<<: *default | |
database: dragnet_production |
The Heroku documentation recommends setting up a welcome page, which I already had by a different name. The next step in their documentation is to store the project in git, which I had already already done.
I ran heroku create
from the root directory then verified the remote was added with git config --list | grep heroku
.
I deployed the code with git push heroku master
and migrated the database with heroku run rake:db migrate
.
I ran a dyno with heroku ps:scale web=1
, checked the state of the dyno with heroku ps
, then paid a little visit heroku open
!
Top comments (0)