Skip to content

Instantly share code, notes, and snippets.

@rrichards
Forked from jtadeulopes/project.conf
Created September 18, 2016 13:59
Show Gist options
  • Save rrichards/9c4b9039957ab47d69bd6d398af82b02 to your computer and use it in GitHub Desktop.
Save rrichards/9c4b9039957ab47d69bd6d398af82b02 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment