Heroku stuff

This commit is contained in:
Andrew Tomaka 2015-10-13 14:21:59 -04:00
parent 06359bbe0b
commit e6bb48eae7
3 changed files with 25 additions and 0 deletions

View file

@ -7,7 +7,9 @@ gem 'sinatra'
gem 'sinatra-activerecord' gem 'sinatra-activerecord'
group :production do group :production do
gem 'rails_12factor'
gem 'pg' gem 'pg'
gem 'puma'
end end
group :development do group :development do

View file

@ -24,9 +24,15 @@ GEM
rb-inotify (>= 0.9) rb-inotify (>= 0.9)
minitest (5.8.1) minitest (5.8.1)
pg (0.18.3) pg (0.18.3)
puma (2.14.0)
rack (1.6.4) rack (1.6.4)
rack-protection (1.5.3) rack-protection (1.5.3)
rack rack
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)
rb-fsevent (0.9.6) rb-fsevent (0.9.6)
rb-inotify (0.9.5) rb-inotify (0.9.5)
ffi (>= 0.5.0) ffi (>= 0.5.0)
@ -51,6 +57,8 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
activerecord activerecord
pg pg
puma
rails_12factor
rerun rerun
sinatra sinatra
sinatra-activerecord sinatra-activerecord

15
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