Try nginx

This commit is contained in:
Piotr Sarnacki 2013-09-01 23:52:51 +02:00
parent 6412a07ad1
commit 97958a4ce4
5 changed files with 14 additions and 2 deletions

View File

@ -1,2 +1,3 @@
https://github.com/heroku/heroku-buildpack-ruby.git
https://github.com/drogus/last-commit-sha-buildpack.git
https://github.com/ryandotsmith/nginx-buildpack.git

View File

@ -1,2 +1,2 @@
web: bundle exec ./script/server
web: bin/start-nginx bundle exec ./script/server
console: bundle exec ./script/console

9
config/puma-config.rb Normal file
View File

@ -0,0 +1,9 @@
root = File.expand_path('../..', __FILE__)
rackup "#{root}/config.ru"
bind 'unix:///tmp/nginx.socket'
environment ENV['RACK_ENV'] || 'development'
threads 0, 16

View File

@ -12,6 +12,7 @@ require 'raven'
require 'sidekiq'
require 'metriks/reporter/logger'
require 'travis/support/log_subscriber/active_record_metrics'
require 'fileutils'
# Rack class implementing the HTTP API.
# Instances respond to #call.
@ -45,6 +46,7 @@ module Travis::Api
def self.setup(options = {})
setup! unless setup?
Endpoint.set(options) if options
FileUtils.touch('/tmp/app-initialized')
end
def self.new(options = {})

View File

@ -3,6 +3,6 @@ cd "$(dirname "$0")/.."
[ $PORT ] || PORT=3000
[ $RACK_ENV ] || RACK_ENV=development
cmd="ruby -I lib -S bundle exec ruby -I lib -S puma config.ru -p $PORT -e $RACK_ENV --threads 0:16"
cmd="ruby -I lib -S bundle exec ruby -I lib -S puma -C config/puma-config.rb"
[[ $RACK_ENV == "development" ]] && exec rerun "$cmd -b tcp://127.0.0.1:$PORT"
exec $cmd