Switch to unicorn
This commit is contained in:
parent
0c3e12dfa3
commit
732b24e1e5
2
Gemfile
2
Gemfile
|
@ -9,7 +9,7 @@ gem 'travis-sidekiqs', github: 'travis-ci/travis-sidekiqs', require: nil, ref: '
|
||||||
gem 'sinatra'
|
gem 'sinatra'
|
||||||
gem 'sinatra-contrib', require: nil #github: 'sinatra/sinatra-contrib', require: nil
|
gem 'sinatra-contrib', require: nil #github: 'sinatra/sinatra-contrib', require: nil
|
||||||
|
|
||||||
gem 'puma', '2.3.1'
|
gem 'unicorn'
|
||||||
gem 'sentry-raven', github: 'getsentry/raven-ruby'
|
gem 'sentry-raven', github: 'getsentry/raven-ruby'
|
||||||
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
|
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
|
||||||
gem 'rack-contrib', github: 'rack/rack-contrib'
|
gem 'rack-contrib', github: 'rack/rack-contrib'
|
||||||
|
|
10
Gemfile.lock
10
Gemfile.lock
|
@ -159,6 +159,7 @@ GEM
|
||||||
i18n (0.6.5)
|
i18n (0.6.5)
|
||||||
journey (1.0.4)
|
journey (1.0.4)
|
||||||
json (1.8.0)
|
json (1.8.0)
|
||||||
|
kgio (2.8.0)
|
||||||
listen (1.2.2)
|
listen (1.2.2)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
|
@ -186,8 +187,6 @@ GEM
|
||||||
coderay (~> 1.0.5)
|
coderay (~> 1.0.5)
|
||||||
method_source (~> 0.8)
|
method_source (~> 0.8)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
puma (2.3.1)
|
|
||||||
rack (>= 1.1, < 2.0)
|
|
||||||
pusher (0.11.3)
|
pusher (0.11.3)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
signature (~> 0.1.6)
|
signature (~> 0.1.6)
|
||||||
|
@ -209,6 +208,7 @@ GEM
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
rdoc (~> 3.4)
|
rdoc (~> 3.4)
|
||||||
thor (>= 0.14.6, < 2.0)
|
thor (>= 0.14.6, < 2.0)
|
||||||
|
raindrops (0.11.0)
|
||||||
rake (0.9.6)
|
rake (0.9.6)
|
||||||
rb-fsevent (0.9.3)
|
rb-fsevent (0.9.3)
|
||||||
rb-inotify (0.9.0)
|
rb-inotify (0.9.0)
|
||||||
|
@ -270,6 +270,10 @@ GEM
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
tzinfo (0.3.37)
|
tzinfo (0.3.37)
|
||||||
|
unicorn (4.6.3)
|
||||||
|
kgio (~> 2.6)
|
||||||
|
rack
|
||||||
|
raindrops (~> 0.7)
|
||||||
uuidtools (2.1.4)
|
uuidtools (2.1.4)
|
||||||
yard (0.8.6.2)
|
yard (0.8.6.2)
|
||||||
|
|
||||||
|
@ -288,7 +292,6 @@ DEPENDENCIES
|
||||||
micro_migrations!
|
micro_migrations!
|
||||||
mocha (~> 0.12)
|
mocha (~> 0.12)
|
||||||
pry
|
pry
|
||||||
puma (= 2.3.1)
|
|
||||||
rack-attack
|
rack-attack
|
||||||
rack-cache (~> 1.2)
|
rack-cache (~> 1.2)
|
||||||
rack-contrib!
|
rack-contrib!
|
||||||
|
@ -303,4 +306,5 @@ DEPENDENCIES
|
||||||
travis-core!
|
travis-core!
|
||||||
travis-sidekiqs!
|
travis-sidekiqs!
|
||||||
travis-support!
|
travis-support!
|
||||||
|
unicorn
|
||||||
yard-sinatra!
|
yard-sinatra!
|
||||||
|
|
|
@ -2,3 +2,10 @@
|
||||||
|
|
||||||
worker_processes 4 # amount of unicorn workers to spin up
|
worker_processes 4 # amount of unicorn workers to spin up
|
||||||
timeout 30 # restarts workers that hang for 15 seconds
|
timeout 30 # restarts workers that hang for 15 seconds
|
||||||
|
|
||||||
|
listen '/tmp/nginx.socket', backlog: 1024
|
||||||
|
|
||||||
|
require 'fileutils'
|
||||||
|
before_fork do |server,worker|
|
||||||
|
FileUtils.touch('/tmp/app-initialized')
|
||||||
|
end
|
||||||
|
|
|
@ -3,6 +3,6 @@ cd "$(dirname "$0")/.."
|
||||||
[ $PORT ] || PORT=3000
|
[ $PORT ] || PORT=3000
|
||||||
[ $RACK_ENV ] || RACK_ENV=development
|
[ $RACK_ENV ] || RACK_ENV=development
|
||||||
|
|
||||||
cmd="ruby -I lib -S bundle exec ruby -I lib -S puma -C config/puma-config.rb"
|
cmd="ruby -I lib -S bundle exec ruby -I lib -S unicorn config.ru -E $RACK_ENV -c config/unicorn.rb"
|
||||||
[[ $RACK_ENV == "development" ]] && exec rerun "$cmd -b tcp://127.0.0.1:$PORT"
|
[[ $RACK_ENV == "development" ]] && exec rerun "$cmd -l 127.0.0.1:$PORT"
|
||||||
exec $cmd
|
exec $cmd
|
||||||
|
|
Loading…
Reference in New Issue
Block a user