diff --git a/Procfile b/Procfile index 5cc4d7e..528ca4b 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: bundle exec rails server -b 0.0.0.0 -p ${PORT:-3000} \ No newline at end of file +web: bundle exec puma -C config/puma.rb \ No newline at end of file diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 0000000..941f057 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,16 @@ +# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server +workers Integer(ENV['WEB_CONCURRENCY'] || 2) +threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5) +threads threads_count, threads_count + +preload_app! + +rackup DefaultRackup if defined?(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 \ No newline at end of file