Skip to content

Instantly share code, notes, and snippets.

@jtadeulopes
Last active December 20, 2018 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jtadeulopes/7254953 to your computer and use it in GitHub Desktop.
Save jtadeulopes/7254953 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