Skip to content

Instantly share code, notes, and snippets.

@aconfee
Last active July 3, 2018 07:50
Show Gist options
  • Save aconfee/8ad3fb3a96dad045bdff60a5ad8823ea to your computer and use it in GitHub Desktop.
Save aconfee/8ad3fb3a96dad045bdff60a5ad8823ea to your computer and use it in GitHub Desktop.
etc/systemd/system/puma.service
[Unit]
Description=Puma HTTP Server
After=network.target
# Uncomment for socket activation (see below)
# Requires=puma.socket
[Service]
# Foreground process (do not use --daemon in ExecStart or config.rb)
Type=simple
# Preferably configure a non-privileged user
User=root
Group=root
# Specify the path to your puma application root
WorkingDirectory=/home/rails/RubyFinanceTracker
# Helpful for debugging socket activation, etc.
# Environment=
# The command to start Puma
# Here we are using a binstub generated via:
# `bundle binstubs puma --path ./sbin`
# in the WorkingDirectory (replace <WD> below)
# You can alternatively use `bundle exec --keep-file-descriptors puma`
# ExecStart=<WD>/sbin/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem
# Alternatively with a config file (in WorkingDirectory) and
# comparable `bind` directives
ExecStart=/usr/local/rvm/wrappers/ruby-2.3.3/puma -C /home/rails/RubyFinanceTracker/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