Add puma file
This commit is contained in:
@@ -112,6 +112,13 @@ namespace :deploy do
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
desc 'Set config/puma.rb-symlink for upstart'
|
||||||
|
task :puma_config do
|
||||||
|
on roles(:app) do
|
||||||
|
execute "ln -s #{shared_path}/puma.rb #{release_path}/config/puma.rb"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
after :finishing, :puma_config
|
||||||
|
|
||||||
after :publishing, :restart do
|
after :publishing, :restart do
|
||||||
#deploy.update_remote_cache
|
#deploy.update_remote_cache
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Change to match your CPU core count
|
||||||
|
workers 2
|
||||||
|
|
||||||
|
# Min and Max threads per worker
|
||||||
|
threads 1, 6
|
||||||
|
|
||||||
|
app_dir = File.expand_path("../..", __FILE__)
|
||||||
|
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
|
||||||
Reference in New Issue
Block a user