Add systemd/sample_ruby_app.service
This commit is contained in:
parent
fe8eddf726
commit
6c424bb9be
23
systemd/sample_ruby_app.service
Normal file
23
systemd/sample_ruby_app.service
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=MyApp
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
|
||||||
|
# App directory
|
||||||
|
WorkingDirectory=/usr/local/src/my_app
|
||||||
|
|
||||||
|
# Load the rvm environment when `systemctl start` is called
|
||||||
|
ExecStart=/bin/bash -lc '/usr/local/rvm/rubies/ruby-3.0.2/bin/bundle exec rackup -p 6080 -o 0.0.0.0 -s puma -E production'
|
||||||
|
|
||||||
|
# Restart when the app or service fails
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
# Environment variables the service or app must use
|
||||||
|
Environment=RAILS_ENV=production
|
||||||
|
|
||||||
|
# `Install` is optional for a service, and it's used here because it's required here.
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user