Skip to content

Instantly share code, notes, and snippets.

@mikej
Last active April 20, 2017 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikej/c3c29fb04ec4f9620caf328fbc1aa2f5 to your computer and use it in GitHub Desktop.
Save mikej/c3c29fb04ec4f9620caf328fbc1aa2f5 to your computer and use it in GitHub Desktop.
puma systemd config
[Unit]
Description=Puma HTTP Server for demoapp
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=deploy
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/home/deploy/.rbenv/bin:/home/deploy/.rbenv/shims"
# Specify the path to your puma application root
WorkingDirectory=/home/deploy/demoapp
# Helpful for debugging socket activation, etc.
# Environment=PUMA_DEBUG=1
# 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
ExecStart=/home/deploy/demoapp/bin/bundle exec --keep-file-descriptors puma -C config/puma.rb
# Alternatively with a config file (in WorkingDirectory) and
# comparable `bind` directives
# ExecStart=<WD>/sbin/puma -C config.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