Skip to content

Instantly share code, notes, and snippets.

@kusakusakusa
Created September 16, 2019 21:49
Show Gist options
  • Save kusakusakusa/cf45a94bfafcbf9b077ed76f1c0db7bb to your computer and use it in GitHub Desktop.
Save kusakusakusa/cf45a94bfafcbf9b077ed76f1c0db7bb to your computer and use it in GitHub Desktop.
rails puma config for server
# frozen_string_literal: true
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
port ENV.fetch('PORT') { 3000 }
environment ENV.fetch('RAILS_ENV') { 'staging' }
bind 'unix:///home/ubuntu/<SOMETHING>/shared/tmp/sockets/puma.sock'
pidfile '/home/ubuntu/<SOMETHING>/shared/tmp/pids/puma.pid'
state_path '/home/ubuntu/<SOMETHING>/shared/tmp/sockets/puma.state'
directory '/home/ubuntu/<SOMETHING>/current'
daemonize true
activate_control_app 'unix:///home/ubuntu/<SOMETHING>/shared/tmp/sockets/pumactl.sock'
prune_bundler
plugin :tmp_restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment