production deployment changes

This commit is contained in:
Min Zeya Phyo
2019-12-20 11:55:45 +06:30
parent e3f2f139e4
commit 704af3ce27
3 changed files with 18 additions and 14 deletions

View File

@@ -28,9 +28,24 @@ set :linked_dirs, %w{log tmp/pids tmp/puma tmp/cache tmp/sockets vendor/bundle p
set :tests, [] set :tests, []
set :pty, true set :pty, true
set :puma_jungle_conf, '/etc/puma.conf' #set :puma_state, "#{shared_path}/tmp/pids/puma.state"
set :puma_run_path, '/usr/local/bin/run-puma' #set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
set :puma_bind, %w(tcp://0.0.0.0:9393) set :puma_bind, %w(tcp://0.0.0.0:9393)
#set :puma_conf, "#{shared_path}/puma.rb"
#set :puma_access_log, "#{shared_path}/log/puma_access.log"
#set :puma_error_log, "#{shared_path}/log/puma_error.log"
#set :puma_role, :app
set :puma_env, fetch(:rack_env, fetch(:rails_env, 'production'))
set :puma_threads, [0, 16]
set :puma_workers, 2
#set :puma_worker_timeout, nil
#set :puma_init_active_record, false
#set :puma_preload_app, false
#set :puma_daemonize, false
#set :puma_plugins, [] #accept array of plugins
#set :puma_tag, fetch(:application)
#set :puma_restart_command, 'bundle exec puma'
#set :enable_ssl, true #set :enable_ssl, true

View File

@@ -13,7 +13,7 @@ set :server_name, "doemal.app"
set :branch, "r-1902001-01" set :branch, "r-1902001-01"
set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}" set :full_app_name, "#{fetch(:application)}_#{fetch(:stage)}"
server '167.71.194.57', user: 'deploy', roles: %w{web app db}, primary: true server '178.128.58.251', user: 'deploy', roles: %w{web app db}, primary: true
set :deploy_to, "/home/#{fetch(:deploy_user)}/apps/#{fetch(:full_app_name)}" set :deploy_to, "/home/#{fetch(:deploy_user)}/apps/#{fetch(:full_app_name)}"
set :rbenv_ruby, '2.6.5' set :rbenv_ruby, '2.6.5'

View File

@@ -1,11 +0,0 @@
application_path="#{File.expand_path("../..", __FILE__)}"
directory application_path
#environment ENV.fetch("RAILS_ENV") { "production" }
environment "production"
pidfile "#{application_path}/tmp/puma/pid"
state_path "#{application_path}/tmp/puma/state"
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
port ENV.fetch("PORT") { 62158 }
workers 2
preload_app!
threads 1,1