Skip to content

Commit

Permalink
added SLL and the Puma webserver in produtction
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagonbotelho committed May 26, 2015
1 parent 7770a5f commit bf76f9f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
gem 'puma', '2.11.1'
end
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
puma (2.11.1)
rack (>= 1.1, < 2.0)
rack (1.6.1)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -219,6 +221,7 @@ DEPENDENCIES
mini_backtrace (= 0.1.3)
minitest-reporters (= 1.0.5)
pg (= 0.17.1)
puma (= 2.11.1)
rails (= 4.2.1)
rails_12factor (= 0.0.2)
sass-rails (~> 5.0)
Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: bundle exec puma -C config/puma.rb
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true
config.force_ssl = true

# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
Expand Down
13 changes: 13 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count

preload_app!

rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
ActiveRecord::Base.establish_connection
end

0 comments on commit bf76f9f

Please sign in to comment.