From dbb24b3815e4dfed03ceef8278f467a7c37a67c5 Mon Sep 17 00:00:00 2001 From: Markus Graf Date: Mon, 5 Oct 2015 16:42:27 +0200 Subject: [PATCH] added puma as webserver for heroku --- Gemfile | 1 + Gemfile.lock | 2 ++ Procfile | 1 + config/puma.rb | 9 +++++++++ 4 files changed, 13 insertions(+) create mode 100644 Procfile create mode 100644 config/puma.rb diff --git a/Gemfile b/Gemfile index cd8bc14..d21f266 100644 --- a/Gemfile +++ b/Gemfile @@ -36,6 +36,7 @@ gem 'slim-rails' gem 'simple_form' gem 'capybara' gem 'rails-i18n' +gem 'puma' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console diff --git a/Gemfile.lock b/Gemfile.lock index 268771e..ae3bcf3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -98,6 +98,7 @@ GEM nokogiri (1.6.6.2) mini_portile (~> 0.6.0) origin (2.1.1) + puma (2.14.0) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) @@ -211,6 +212,7 @@ DEPENDENCIES jquery-rails mongoid (~> 5.0.0) mongoid-rspec (= 3.0.0) + puma rails (= 4.2.4) rails-i18n rspec-rails (~> 3.0) diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..c2c566e --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bundle exec puma -C config/puma.rb diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..c4c3f02 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,9 @@ +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'