Use puma instead of unicorn
Puma is the server we use in the development environment, so this way we don't need to maintain two servers. Furthermore, puma seems to offer a few advantages over unicorn (like multithreading) and no disadvantages.
This commit is contained in:
3
Capfile
3
Capfile
@@ -12,6 +12,9 @@ require "capistrano/delayed_job"
|
||||
require "whenever/capistrano"
|
||||
require "rvm1/capistrano3"
|
||||
|
||||
require "capistrano/puma"
|
||||
install_plugin Capistrano::Puma
|
||||
|
||||
#SCM: Git
|
||||
require "capistrano/scm/git"
|
||||
install_plugin Capistrano::SCM::Git
|
||||
|
||||
4
Gemfile
4
Gemfile
@@ -41,6 +41,7 @@ gem "paperclip", "~> 5.2.1"
|
||||
gem "paranoia", "~> 2.4.2"
|
||||
gem "pg", "~> 0.21.0"
|
||||
gem "pg_search", "~> 2.0.1"
|
||||
gem "puma", "~> 4.2.1"
|
||||
gem "recipient_interceptor", "~> 0.2.0"
|
||||
gem "redcarpet", "~> 3.4.0"
|
||||
gem "responders", "~> 2.4.0"
|
||||
@@ -55,7 +56,6 @@ gem "translator-text", "~> 0.1.0"
|
||||
gem "turbolinks", "~> 2.5.3"
|
||||
gem "turnout", "~> 2.4.0"
|
||||
gem "uglifier", "~> 4.1.2"
|
||||
gem "unicorn", "~> 5.4.1"
|
||||
gem "whenever", "~> 0.10.0", require: false
|
||||
gem "wicked_pdf", "~> 1.1.0"
|
||||
gem "wkhtmltopdf-binary", "~> 0.12.4"
|
||||
@@ -74,7 +74,6 @@ group :development, :test do
|
||||
gem "knapsack_pro", "~> 1.1.0"
|
||||
gem "launchy", "~> 2.4.3"
|
||||
gem "letter_opener_web", "~> 1.3.4"
|
||||
gem "puma", "~> 4.1.1"
|
||||
gem "spring", "~> 2.0.1"
|
||||
gem "spring-commands-rspec", "~> 1.0.4"
|
||||
end
|
||||
@@ -94,6 +93,7 @@ group :development do
|
||||
gem "capistrano-bundler", "~> 1.2", require: false
|
||||
gem "capistrano-rails", "~> 1.4.0", require: false
|
||||
gem "capistrano3-delayed-job", "~> 1.7.3"
|
||||
gem "capistrano3-puma", "~> 4.0.0"
|
||||
gem "erb_lint", require: false
|
||||
gem "mdl", "~> 0.5.0", require: false
|
||||
gem "rubocop", "~> 0.75.0", require: false
|
||||
|
||||
15
Gemfile.lock
15
Gemfile.lock
@@ -116,6 +116,10 @@ GEM
|
||||
capistrano3-delayed-job (1.7.5)
|
||||
capistrano (~> 3.0, >= 3.0.0)
|
||||
daemons (~> 1.2.4)
|
||||
capistrano3-puma (4.0.0)
|
||||
capistrano (~> 3.7)
|
||||
capistrano-bundler
|
||||
puma (~> 4.0)
|
||||
capybara (2.17.0)
|
||||
addressable
|
||||
mini_mime (>= 0.1.3)
|
||||
@@ -301,7 +305,6 @@ GEM
|
||||
activerecord
|
||||
kaminari-core (= 1.1.1)
|
||||
kaminari-core (1.1.1)
|
||||
kgio (2.11.2)
|
||||
knapsack_pro (1.1.0)
|
||||
rake
|
||||
kramdown (1.17.0)
|
||||
@@ -388,7 +391,7 @@ GEM
|
||||
activesupport (>= 4.2)
|
||||
arel (>= 6)
|
||||
public_suffix (4.0.1)
|
||||
puma (4.1.1)
|
||||
puma (4.2.1)
|
||||
nio4r (~> 2.0)
|
||||
rack (2.0.7)
|
||||
rack-accept (0.4.5)
|
||||
@@ -428,7 +431,6 @@ GEM
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rainbow (3.0.0)
|
||||
raindrops (0.19.0)
|
||||
rake (12.3.3)
|
||||
recipient_interceptor (0.2.0)
|
||||
mail
|
||||
@@ -554,9 +556,6 @@ GEM
|
||||
uglifier (4.1.19)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unicode-display_width (1.6.0)
|
||||
unicorn (5.4.1)
|
||||
kgio (~> 2.6)
|
||||
raindrops (~> 0.7)
|
||||
uniform_notifier (1.11.0)
|
||||
user_agent_parser (2.4.1)
|
||||
uuidtools (2.1.5)
|
||||
@@ -598,6 +597,7 @@ DEPENDENCIES
|
||||
capistrano-bundler (~> 1.2)
|
||||
capistrano-rails (~> 1.4.0)
|
||||
capistrano3-delayed-job (~> 1.7.3)
|
||||
capistrano3-puma (~> 4.0.0)
|
||||
capybara (~> 2.17.0)
|
||||
capybara-webmock (~> 0.5.3)
|
||||
ckeditor (~> 4.2.3)
|
||||
@@ -641,7 +641,7 @@ DEPENDENCIES
|
||||
paranoia (~> 2.4.2)
|
||||
pg (~> 0.21.0)
|
||||
pg_search (~> 2.0.1)
|
||||
puma (~> 4.1.1)
|
||||
puma (~> 4.2.1)
|
||||
rails (= 5.0.7.2)
|
||||
rails-assets-leaflet!
|
||||
rails-assets-markdown-it (~> 8.2.1)!
|
||||
@@ -669,7 +669,6 @@ DEPENDENCIES
|
||||
turbolinks (~> 2.5.3)
|
||||
turnout (~> 2.4.0)
|
||||
uglifier (~> 4.1.2)
|
||||
unicorn (~> 5.4.1)
|
||||
web-console (~> 3.3.0)
|
||||
whenever (~> 0.10.0)
|
||||
wicked_pdf (~> 1.1.0)
|
||||
|
||||
@@ -21,7 +21,7 @@ set :log_level, :info
|
||||
set :pty, true
|
||||
set :use_sudo, false
|
||||
|
||||
set :linked_files, %w[config/database.yml config/secrets.yml config/unicorn.rb config/environments/production.rb]
|
||||
set :linked_files, %w[config/database.yml config/secrets.yml config/environments/production.rb]
|
||||
set :linked_dirs, %w[log tmp public/system public/assets public/ckeditor_assets]
|
||||
|
||||
set :keep_releases, 5
|
||||
@@ -35,7 +35,6 @@ set(:config_files, %w[
|
||||
log_rotation
|
||||
database.yml
|
||||
secrets.yml
|
||||
unicorn.rb
|
||||
])
|
||||
|
||||
set :whenever_roles, -> { :app }
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace :deploy do
|
||||
desc "Restart Unicorn"
|
||||
task :restart do
|
||||
on roles(:app) do
|
||||
execute "kill -QUIT `cat #{deploy_to}/pids/unicorn.pid`; true"
|
||||
execute "kill -QUIT `cat #{shared_path}/pids/unicorn.pid`; true"
|
||||
execute "kill -QUIT `cat #{shared_path}/tmp/pids/unicorn.pid`; true"
|
||||
execute "cd #{release_path} && bundle exec unicorn -c config/unicorn.rb -E production -D"
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user