Added SSL, Changed production web server to Puma
This commit is contained in:
parent
dceca868a9
commit
cc9eed698a
5 changed files with 22 additions and 1 deletions
1
Gemfile
1
Gemfile
|
|
@ -55,6 +55,7 @@ end
|
||||||
group :production do
|
group :production do
|
||||||
gem 'pg','0.17.1'
|
gem 'pg','0.17.1'
|
||||||
gem 'rails_12factor','0.0.2'
|
gem 'rails_12factor','0.0.2'
|
||||||
|
gem 'puma', '2.11.1'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,8 @@ GEM
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
win32console (~> 1.3)
|
win32console (~> 1.3)
|
||||||
|
puma (2.11.1)
|
||||||
|
rack (>= 1.1, < 2.0)
|
||||||
rack (1.6.0)
|
rack (1.6.0)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
|
|
@ -227,6 +229,7 @@ DEPENDENCIES
|
||||||
mini_backtrace
|
mini_backtrace
|
||||||
minitest-reporters
|
minitest-reporters
|
||||||
pg (= 0.17.1)
|
pg (= 0.17.1)
|
||||||
|
puma (= 2.11.1)
|
||||||
rails (= 4.2.0)
|
rails (= 4.2.0)
|
||||||
rails_12factor (= 0.0.2)
|
rails_12factor (= 0.0.2)
|
||||||
sass-rails (~> 5.0)
|
sass-rails (~> 5.0)
|
||||||
|
|
|
||||||
1
Procfile
Normal file
1
Procfile
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
web: bundle exec puma -C config/puma.rb
|
||||||
|
|
@ -42,7 +42,7 @@ Rails.application.configure do
|
||||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
# 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.
|
# 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
|
# Use the lowest log level to ensure availability of diagnostic information
|
||||||
# when problems arise.
|
# when problems arise.
|
||||||
|
|
|
||||||
16
config/puma.rb
Normal file
16
config/puma.rb
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
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
|
||||||
|
# Worker specific setup for Rails 4.1+
|
||||||
|
# See: https://devcenter.heroku.com/articles/
|
||||||
|
# deploying-rails-applications-with-the-puma-web-server#on-worker-boot
|
||||||
|
ActiveRecord::Base.establish_connection
|
||||||
|
end
|
||||||
Loading…
Add table
Reference in a new issue