Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env puma
- environment 'staging'
- pidfile "/myapp/tmp/pids_puma.pid"
- state_path "/myapp/tmp/pids_puma.state"
- stdout_redirect '/myapp/log/puma_access.log', '/myapp/log/puma_error.log', true
- threads 2, 8
- bind 'tcp://0.0.0.0:3000'
- workers 2
- prune_bundler
- on_restart do
- puts 'Refreshing Gemfile'
- ENV['BUNDLE_GEMFILE'] = '/myapp/Gemfile'
- end
- on_worker_boot do |worker_index|
- # write worker pid
- pid_filename = "/myapp/tmp/pids_puma_worker_#{worker_index}.pid"
- File.open(pid_filename, 'w') { |f| f.puts Process.pid }
- begin
- # Re-open appenders after forking the process
- SemanticLogger.reopen if defined?( SemanticLogger )
- rescue Exception => e
- puts "Error trying to reopen log, probably because the SemanticLogger gem is not used in this project: #{e.message}"
- end
- end
- activate_control_app 'unix:///myapp/tmp/sockets_pumactl.sock'
Add Comment
Please, Sign In to add comment