1
0
Fork 0

Setup for heroku

This commit is contained in:
Andrew Tomaka 2015-10-07 15:52:45 -04:00
parent da3d78a32a
commit d063f75fcc
4 changed files with 35 additions and 3 deletions

View file

@ -1,7 +1,6 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'rails', '4.2.4' gem 'rails', '4.2.4'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0' gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0' gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0' gem 'coffee-rails', '~> 4.1.0'
@ -16,9 +15,16 @@ gem 'simple_form'
gem 'omniauth-reddit', :git => 'git://github.com/jackdempsey/omniauth-reddit.git' gem 'omniauth-reddit', :git => 'git://github.com/jackdempsey/omniauth-reddit.git'
group :production do
gem 'rails_12factor'
gem 'pg'
gem 'puma'
end
group :development, :test do group :development, :test do
gem 'dotenv-rails' gem 'dotenv-rails'
gem 'byebug' gem 'byebug'
gem 'sqlite3'
end end
group :development do group :development do

View file

@ -113,6 +113,8 @@ GEM
omniauth-oauth2 (1.3.1) omniauth-oauth2 (1.3.1)
oauth2 (~> 1.0) oauth2 (~> 1.0)
omniauth (~> 1.2) omniauth (~> 1.2)
pg (0.18.3)
puma (2.14.0)
quiet_assets (1.1.0) quiet_assets (1.1.0)
railties (>= 3.1, < 5.0) railties (>= 3.1, < 5.0)
rack (1.6.4) rack (1.6.4)
@ -142,6 +144,11 @@ GEM
ruby-graphviz (~> 1.2) ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.0.2) rails-html-sanitizer (1.0.2)
loofah (~> 2.0) loofah (~> 2.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.4)
rails_stdout_logging (0.0.4)
railties (4.2.4) railties (4.2.4)
actionpack (= 4.2.4) actionpack (= 4.2.4)
activesupport (= 4.2.4) activesupport (= 4.2.4)
@ -207,9 +214,12 @@ DEPENDENCIES
jbuilder (~> 2.0) jbuilder (~> 2.0)
jquery-rails jquery-rails
omniauth-reddit! omniauth-reddit!
pg
puma
quiet_assets quiet_assets
rails (= 4.2.4) rails (= 4.2.4)
rails-erd rails-erd
rails_12factor
sass-rails (~> 5.0) sass-rails (~> 5.0)
sdoc (~> 0.4.0) sdoc (~> 0.4.0)
simple_form simple_form

View file

@ -21,5 +21,6 @@ test:
database: db/test.sqlite3 database: db/test.sqlite3
production: production:
<<: *default adapter: postgresql
database: db/production.sqlite3 encoding: unicode
pool: 5

15
config/puma.rb Normal file
View file

@ -0,0 +1,15 @@
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
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