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.

21 lines
477 B

  1. threads_count = ENV.fetch('MAX_THREADS') { 5 }.to_i
  2. threads threads_count, threads_count
  3. if ENV['SOCKET']
  4. bind "unix://#{ENV['SOCKET']}"
  5. else
  6. bind "tcp://#{ENV.fetch('BIND', '127.0.0.1')}:#{ENV.fetch('PORT', 3000)}"
  7. end
  8. environment ENV.fetch('RAILS_ENV') { 'development' }
  9. workers ENV.fetch('WEB_CONCURRENCY') { 2 }
  10. preload_app!
  11. on_worker_boot do
  12. ActiveSupport.on_load(:active_record) do
  13. ActiveRecord::Base.establish_connection
  14. end
  15. end
  16. plugin :tmp_restart