Skip to content

Instantly share code, notes, and snippets.

@songjiz
Created January 16, 2021 12:41
Show Gist options
  • Save songjiz/b0e36a34721c3a2284f99c2e60c2f9e2 to your computer and use it in GitHub Desktop.
Save songjiz/b0e36a34721c3a2284f99c2e60c2f9e2 to your computer and use it in GitHub Desktop.
systemd puma service
[Unit]
Description=Puma HTTP Server
After=network.target
# Uncomment for socket activation (see below)
# Requires=puma.socket
[Service]
Type=simple
# Preferably configure a non-privileged user
# User=
# The path to the your application code root directory.
# Also replace the "<YOUR_APP_PATH>" place holders below with this path.
# Example /home/username/myapp
WorkingDirectory=/var/www/app/current
# Helpful for debugging socket activation, etc.
# Environment=PUMA_DEBUG=1
Environment="RAILS_ENV=production"
ExecStart=/root/.rbenv/shims/bundle exec puma -C /var/www/app/shared/config/puma.rb
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