Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to Heroku #16

Open
wants to merge 1 commit into
base: redux-generations-2017-03-03
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
source 'https://rubygems.org'

ruby "2.3.1"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use sqlite3 as the database for Active Record

gem "react_on_rails", path: "../react_on_rails"
gem "react_on_rails"

gem 'sqlite3'
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
Expand Down
24 changes: 10 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
PATH
remote: ../react_on_rails
specs:
react_on_rails (6.6.0)
addressable
connection_pool
execjs (~> 2.5)
rails (>= 3.2)
rainbow (~> 2.1)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -76,7 +66,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
libv8 (5.3.332.38.3-x86_64-darwin-16)
libv8 (5.3.332.38.3)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -96,6 +86,7 @@ GEM
nio4r (2.0.0)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
pg (0.19.0)
public_suffix (2.0.5)
puma (3.7.1)
rack (2.0.1)
Expand Down Expand Up @@ -129,6 +120,12 @@ GEM
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
react_on_rails (6.7.1)
addressable
connection_pool
execjs (~> 2.5)
rails (>= 3.2)
rainbow (~> 2.1)
sass (3.4.23)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
Expand All @@ -148,7 +145,6 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.6)
Expand Down Expand Up @@ -178,13 +174,13 @@ DEPENDENCIES
jquery-rails
listen (~> 3.0.5)
mini_racer
pg
puma (~> 3.0)
rails (~> 5.0.0, >= 5.0.0.1)
react_on_rails!
react_on_rails
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec puma -C config/puma.rb
12 changes: 7 additions & 5 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@
"build:production": "NODE_ENV=production webpack --config webpack.config.js",
"build:development": "webpack -w --config webpack.config.js"
},
"cacheDirectories": ["node_modules", "client/node_modules"],
"cacheDirectories": [
"node_modules",
"client/node_modules"
],
"dependencies": {
"babel-cli": "^6.23.0",
"babel-core": "^6.23.1",
"babel-loader": "^6.3.2",
"babel-runtime": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-2": "^6.22.0",
"babel-runtime": "^6.23.0",
"es5-shim": "^4.5.9",
"expose-loader": "^0.7.3",
"imports-loader": "^0.7.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-on-rails": "6.6.0",
"react-on-rails": "^6.7.1",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"webpack": "^2.2.1"
},
"devDependencies": {
}
"devDependencies": {}
}
6 changes: 3 additions & 3 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2138,9 +2138,9 @@ react-dom@^15.4.2:
loose-envify "^1.1.0"
object-assign "^4.1.0"

react-on-rails@6.6.0:
version "6.6.0"
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-6.6.0.tgz#8182911801d8ef0642ade3b2f136639239a621f1"
react-on-rails@^6.7.1:
version "6.7.1"
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-6.7.1.tgz#8e2cb3030883f160ac5a714aefa125ae78cfd9c0"

react-redux@^5.0.3:
version "5.0.3"
Expand Down
19 changes: 7 additions & 12 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
adapter: postgresql
username:
password:
host: localhost

development:
<<: *default
database: db/development.sqlite3
database: ror_redux_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: db/test.sqlite3
database: ror_redux_test

production:
<<: *default
database: db/production.sqlite3
database: ror_redux_production
54 changes: 11 additions & 43 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -1,47 +1,15 @@
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count

# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
#
port ENV.fetch("PORT") { 3000 }
preload_app!

# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'

# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).
#
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }

# Use the `preload_app!` method when specifying a `workers` number.
# This directive tells Puma to first boot the application and load code
# before forking the application. This takes advantage of Copy On Write
# process behavior so workers use less memory. If you use this option
# you need to make sure to reconnect any threads in the `on_worker_boot`
# block.
#
# preload_app!

# The code in the `on_worker_boot` will be called if you are using
# clustered mode by specifying a number of `workers`. After each worker
# process is booted this block will be run, if you are using `preload_app!`
# option you will want to use this block to reconnect to any threads
# or connections that may have been created at application boot, Ruby
# cannot share connections between processes.
#
# on_worker_boot do
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
# end

# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
on_worker_boot do
# Worker specific setup for Rails 4.1+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
ActiveRecord::Base.establish_connection
end
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Rails.application.routes.draw do
root "hello_world#index"

get 'hello_world', to: 'hello_world#index'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
18 changes: 18 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 0) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

end