Created
April 7, 2021 22:46
-
-
Save reynardmh/00a2058c93d792c348a84cee654fa49e to your computer and use it in GitHub Desktop.
Template: Puma systemd for rails app using rvm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Place this in /etc/systemd/system/puma-myapp.service | |
| [Unit] | |
| Description=Myapp Puma Server | |
| After=network.target | |
| [Service] | |
| Type=simple | |
| User=ubuntu | |
| EnvironmentFile=/var/www/myapp/current/.env | |
| Environment=RAILS_ENV=staging | |
| WorkingDirectory=/var/www/myapp/current/ | |
| ExecStart=/home/ubuntu/.rvm/bin/rvm-exec ruby-2.6.6 bundle exec puma -C /var/www/myapp/shared/puma.rb | |
| ExecStop=/home/ubuntu/.rvm/bin/rvm-exec ruby-2.6.6 bundle exec pumactl -F /var/www/myapp/shared/puma.rb stop | |
| ExecReload=/home/ubuntu/.rvm/bin/rvm-exec ruby-2.6.6 bundle exec pumactl -F /var/www/myapp/shared/puma.rb phased-restart | |
| TimeoutSec=15 | |
| Restart=always | |
| KillMode=process | |
| [Install] | |
| WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment