Skip to content

Instantly share code, notes, and snippets.

@yusupova
Created January 28, 2017 12:27
Show Gist options
  • Save yusupova/795ae347e3d38b877975a524cc1d2cdc to your computer and use it in GitHub Desktop.
Save yusupova/795ae347e3d38b877975a524cc1d2cdc to your computer and use it in GitHub Desktop.
systemd service to start your Rails app with Puma
# /etc/systemd/system/rails-puma.service
# rvm wrapper default systemd rails
# systemctl enable rails-puma
# systemctl start rails-puma
[Unit]
Description=Rails Puma Webserver
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/var/www/your-app/current
ExecStart=/bin/bash -lc 'bundle exec puma -C /var/www/your-app/shared/puma.rb'
TimeoutSec=15
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