rrichards
9/18/2016 - 1:59 PM

Puma upstart

Puma upstart

description "project server config"

pre-start script
  mkdir -p /var/log/puma
  chown deploy. /var/log/puma

  mkdir -p /var/run/puma
  chown deploy. /var/run/puma
end script

start on runlevel [23]
stop on shutdown

respawn

script
exec /bin/bash <<'EOT'
  # export RAILS_ENV=production
  # export APP_HOST=http://
  # Some environment variables...
  
  exec sudo -E -u deploy sh -c "cd /var/www/project/current && RAILS_ENV=production bundle exec puma -C config/puma.rb"
EOT
end script