This commit is contained in:
bry4n 2013-11-23 18:34:29 -06:00
Родитель 6640060c07
Коммит fbc431f13d
5 изменённых файлов: 45 добавлений и 13 удалений

10
Gemfile
Просмотреть файл

@ -11,9 +11,10 @@ gem 'memcachier'
gem 'newrelic_rpm', '~> 3.5.3.25'
gem 'octokit'
gem "pg"
gem 'thin'
gem 'rack-timeout'
gem 'tilt'
gem 'tire'
gem 'unicorn'
# TODO: Remove HTTP Clients
gem 'excon'
@ -42,11 +43,14 @@ gem 'uglifier'
group :development do
gem "awesome_print"
gem "shotgun"
gem "sqlite3"
gem "foreman"
gem "taps"
end
group :development, :test do
gem "sqlite3"
end
group :test do
gem 'factory_girl_rails'
gem 'shoulda', :require => false

Просмотреть файл

@ -50,11 +50,10 @@ GEM
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
curb (0.8.5)
daemons (1.1.9)
dalli (2.6.4)
diff-lcs (1.2.4)
dotenv (0.9.0)
erubis (2.7.0)
eventmachine (1.0.3)
exceptional (2.0.33)
rack
excon (0.27.6)
@ -73,6 +72,9 @@ GEM
loofah (~> 1.2.1)
nokogiri (~> 1.6.0)
sax-machine (~> 0.2.1)
foreman (0.63.0)
dotenv (>= 0.7)
thor (>= 0.13.6)
fssm (0.2.10)
haml (4.0.3)
tilt
@ -84,6 +86,7 @@ GEM
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.0)
kgio (2.8.1)
launchy (2.3.0)
addressable (~> 2.3)
less (2.4.0)
@ -120,6 +123,7 @@ GEM
rack
rack-test (0.6.2)
rack (>= 1.0)
rack-timeout (0.0.4)
rails (3.2.15)
actionmailer (= 3.2.15)
actionpack (= 3.2.15)
@ -135,6 +139,7 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
raindrops (0.12.0)
rake (10.1.0)
rdoc (3.12.2)
json (~> 1.4)
@ -154,8 +159,6 @@ GEM
sax-machine (0.2.1)
nokogiri (~> 1.6.0)
sequel (3.20.0)
shotgun (0.9)
rack (>= 1.0)
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (>= 1.4.1, < 3.0)
@ -178,10 +181,6 @@ GEM
therubyracer (0.12.0)
libv8 (~> 3.16.14.0)
ref
thin (1.5.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.18.1)
tilt (1.4.1)
tire (0.6.1)
@ -199,6 +198,10 @@ GEM
uglifier (2.2.1)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
unicorn (4.7.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
yajl-ruby (1.1.0)
PLATFORMS
@ -217,6 +220,7 @@ DEPENDENCIES
faraday
faraday_middleware
feedzirra
foreman
haml
jquery-rails
json
@ -228,18 +232,18 @@ DEPENDENCIES
newrelic_rpm (~> 3.5.3.25)
octokit
pg
rack-timeout
rails (= 3.2.15)
redcarpet
rest-client
rubyzip
sass-rails
shotgun
shoulda
sqlite3
taps
therubyracer
thin
tilt
tire
uglifier
unicorn
yajl-ruby

1
Procfile Normal file
Просмотреть файл

@ -0,0 +1 @@
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

Просмотреть файл

@ -0,0 +1 @@
Rack::Timeout.timeout = 10

22
config/unicorn.rb Normal file
Просмотреть файл

@ -0,0 +1,22 @@
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
end
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end