move to socket, cleanup

master
Thomas Riboulet 10 years ago
parent fadb52d35c
commit c2b3e03326

@ -2,7 +2,7 @@ require "bundler/capistrano"
set :bundle_flags, "--deployment --quiet --binstubs"
set :domain, "109.107.37.177"
set :application, "sinatra_hello"
set :deploy_to, "/home/rails/#{application}"
set :deploy_to, "/home/rails/app"
set :unicorn_conf, "#{deploy_to}/current/config/unicorn.rb"
set :unicorn_pid, "#{deploy_to}/shared/pids/unicorn.pid"
@ -31,6 +31,13 @@ set :deploy_via, :remote_cache
# Unicorn control tasks
namespace :deploy do
task :setup_config, roles: :app do
run "mkdir -p #{shared_path}/config"
run "mkdir -p #{shared_path}/pids"
run "mkdir -p #{shared_path}/logs"
run "mkdir -p #{shared_path}/sockets"
end
task :symlink_config, roles: :app do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/config/unicorn.rb #{release_path}/config/unicorn.rb"

@ -1,8 +1,8 @@
# define paths and filenames
deploy_to = "/home/rails/sinatra_hello"
deploy_to = "/home/rails/app"
rails_root = "#{deploy_to}/current"
pid_file = "#{deploy_to}/shared/pids/unicorn.pid"
socket_file= "#{deploy_to}/shared/unicorn.sock"
socket_file= "#{deploy_to}/shared/sockets/unicorn.sock"
log_file = "#{deploy_to}/shared/logs/unicorn.log"
err_log = "#{deploy_to}/shared/logs/unicorn_error.log"
old_pid = pid_file + '.oldbin'
@ -10,7 +10,7 @@ port = 8080
timeout 30
worker_processes 2 # increase or decrease
listen port, :backlog => 1024
listen socket_file, :backlog => 64
pid pid_file
stderr_path err_log

Loading…
Cancel
Save