Skip to content

Instantly share code, notes, and snippets.

@hackedunit
Created February 16, 2017 11:43
Show Gist options
  • Select an option

  • Save hackedunit/451a43a212f3868ed9c8c4fa84008191 to your computer and use it in GitHub Desktop.

Select an option

Save hackedunit/451a43a212f3868ed9c8c4fa84008191 to your computer and use it in GitHub Desktop.

Revisions

  1. hackedunit created this gist Feb 16, 2017.
    31 changes: 31 additions & 0 deletions puma.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    [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=deployer
    Group=deployer

    # Specify the path to your puma application root
    WorkingDirectory=/home/deployer/app

    # 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=/usr/local/bin/puma -C /home/deployer/app/config/puma.rb

    Restart=always

    [Install]
    WantedBy=multi-user.target