Created
February 17, 2015 02:02
-
-
Save sebatyler/4116f9b1bdd80659d4f9 to your computer and use it in GitHub Desktop.
puma ruby on rails deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :puma_conf, "#{fetch(:deploy_to)}/current/config/puma.rb" | |
# default hook 끄고 항상 phased-restart (zero downtime) | |
namespace :puma do | |
Rake::Task['check'].clear_actions | |
Rake::Task['smart_restart'].clear_actions | |
end | |
after 'deploy:finished', 'puma:phased-restart' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RACK_ENV = ENV['RACK_ENV'] || 'production' | |
PREFIX = "/var/www/rails/#{RACK_ENV}" | |
CURRENT = "#{PREFIX}/current" | |
SHARED = "#{PREFIX}/shared" | |
environment "#{RACK_ENV}" | |
rackup "#{CURRENT}/config.ru" | |
pidfile "#{SHARED}/tmp/pids/puma.pid" | |
state_path "#{SHARED}/tmp/pids/puma.state" | |
stdout_redirect "#{SHARED}/log/puma_access.log", "#{SHARED}/log/puma_error.log", true | |
bind "unix://#{SHARED}/tmp/sockets/puma.sock" | |
threads 8, 32 | |
workers 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment