Skip to content

Instantly share code, notes, and snippets.

@argent-smith
Created February 17, 2017 10:19
Show Gist options
  • Save argent-smith/b8f05b3b18f070ee23c88ed462d4cfa3 to your computer and use it in GitHub Desktop.
Save argent-smith/b8f05b3b18f070ee23c88ed462d4cfa3 to your computer and use it in GitHub Desktop.
puma config template
#!/usr/bin/env puma
require "pathname"
_num_workers = {{ ansible_processor_vcpus }}
_working_dir = Pathname.new("{{ deploy_to }}/current")
_rails_env = "{{ rails_env }}"
workers _num_workers
directory _working_dir.to_s
rackup _working_dir.join("config.ru").to_s
environment _rails_env
daemonize false
pidfile _working_dir.join("tmp/pids/puma.pid").to_s
state_path _working_dir.join("tmp/pids/puma.state").to_s
threads 0,{{ puma_max_threads }}
bind "unix://{{ deploy_to }}/shared/tmp/sockets/puma.sock"
on_restart do
puts "On restart..."
end
on_worker_boot do
puts "On worker boot..."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment