You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
498B

  1. threads_count = ENV.fetch 'RAILS_MAX_THREADS', 5
  2. threads threads_count, threads_count
  3. env = ENV.fetch 'RAILS_ENV', 'development'
  4. environment env
  5. unless Rails.root
  6. module Rails
  7. ROOT = Dir.pwd
  8. def self.root
  9. ROOT
  10. end
  11. end
  12. end
  13. workers 4 if env == 'production'
  14. port = ENV['PORT']
  15. if port
  16. port(port)
  17. else
  18. listen = ENV.fetch('LISTEN') { 'unix://' + File.join(Rails.root, 'tmp/sockets/puma.sock') }
  19. bind listen
  20. end
  21. pidfile File.join Rails.root, 'tmp/pids/puma.pid'
  22. plugin :tmp_restart