Skip to content

Instantly share code, notes, and snippets.

@alobato
Created June 28, 2017 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alobato/f4a4cfa6c38c53ce8cf88f63c106c525 to your computer and use it in GitHub Desktop.
Save alobato/f4a4cfa6c38c53ce8cf88f63c106c525 to your computer and use it in GitHub Desktop.
app_name = "appname"
app_dir = "/home/deployer/apps/#{app_name}"
# Change to match your CPU core count
workers 1
# Min and Max threads per worker
threads 1, 6
shared_dir = "#{app_dir}/shared"
# Default to production
rails_env = ENV['RAILS_ENV'] || "production"
environment rails_env
# Set up socket location
bind "unix://#{shared_dir}/sockets/puma.sock"
# Logging
stdout_redirect "#{shared_dir}/log/puma.stdout.log", "#{shared_dir}/log/puma.stderr.log", true
# Set master PID and state locations
pidfile "#{shared_dir}/pids/puma.pid"
state_path "#{shared_dir}/pids/puma.state"
activate_control_app
# on_worker_boot do
# require "active_record"
# ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
# ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[rails_env])
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment