Skip to content

Instantly share code, notes, and snippets.

@dukejones
Last active July 29, 2020 19:17
Show Gist options
  • Save dukejones/b951594dd10e535e7da59824355d3db0 to your computer and use it in GitHub Desktop.
Save dukejones/b951594dd10e535e7da59824355d3db0 to your computer and use it in GitHub Desktop.
Manage Puma server with SystemD and rbenv
[Unit]
Description=Puma HTTP Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/srv/app/current
# Helpful for debugging socket activation, etc.
# Environment=PUMA_DEBUG=1
Environment=RAILS_ENV=production
Environment=PORT=9292
ExecStart=/home/deploy/.rbenv/shims/bundle exec --keep-file-descriptors puma -C /srv/app/current/config/puma.rb
# Variant: Specify directives inline.
# ExecStart=/<FULLPATH>/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment