Minimal, annotated configuration files for zero-downtime Capistrano deployment of a Rack application served by Unicorn. Why? See GitHub's "Unicorn!" and "Deployment Script Spring Cleaning" blog posts.
The most important files:
-
config/deploy.rb
configures Capistrano to start and stop Unicorn master processes -
config/unicorn.rb
puts pidfiles in the right places and sets a callback to QUIT Unicorn master processes running older releases of the codebase -
config/deployment_paths.rb
ensures Capistrano and Unicorn look for important files in the same places -
etc/nginx.conf
configures the NGINX server to proxy through the Unicorn socket for dynamic page requests