| 1 | workers Integer(ENV['WEB_CONCURRENCY'] || 2) |
| 2 | threads_count = Integer(ENV['MAX_THREADS'] || 5) |
| 3 | threads threads_count, threads_count |
| 4 | |
| 5 | preload_app! |
| 6 | |
| 7 | rackup DefaultRackup |
| 8 | port ENV['PORT'] || 3000 # Don't change this since the nginx use it on production. |
| 9 | environment ENV['RAILS_ENV'] || 'development' |
| 10 | |
| 11 | if ENV['RAILS_ENV'] == 'development' |
| 12 | localhost_key = File.join('setup', 'certificates', 'localhost-key.pem').to_s |
| 13 | localhost_crt = File.join('setup', 'certificates', 'localhost.pem').to_s |
| 14 | # To be able to use rake etc |
| 15 | ssl_bind '0.0.0.0', 3001, { |
| 16 | key: localhost_key, |
| 17 | cert: localhost_crt, |
| 18 | verify_mode: 'none' |
| 19 | } |
| 20 | end |
| 21 | |
| 22 | on_worker_boot do |
| 23 | # Worker specific setup for Rails 4.1+ |
| 24 | # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot |
| 25 | ActiveRecord::Base.establish_connection |
| 26 | end |