Skip to content

Instantly share code, notes, and snippets.

@mateuszdw
Created November 28, 2017 22:49
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 mateuszdw/bab68d5989b3f71faadabb1a47ad571e to your computer and use it in GitHub Desktop.
Save mateuszdw/bab68d5989b3f71faadabb1a47ad571e 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]
# Foreground process (do not use --daemon in ExecStart or config.rb)
Type=simple
# Preferably configure a non-privileged user
User=md
Group=md
# Specify the path to your puma application root
WorkingDirectory=/home/....
# Helpful for debugging socket activation, etc.
# Environment=PUMA_DEBUG=1
# EnvironmentFile=/home/deployer/app/.env
# The command to start 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=/usr/local/bin/bundle exec --keep-file-descriptors puma -e production
ExecStart=/bin/bash -lc 'bundle exec puma -C /home/......../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