Skip to content

Instantly share code, notes, and snippets.

@tomcbe
Forked from r00takaspin/puma.service
Created June 28, 2019 17:05

Revisions

  1. @r00takaspin r00takaspin created this gist May 11, 2018.
    34 changes: 34 additions & 0 deletions puma.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    [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=

    # The path to the puma application root
    # Also replace the "<WD>" place holders below with this path.

    # Helpful for debugging socket activation, etc.
    # Environment=PUMA_DEBUG=1
    # The command to start Puma. This variant uses a binstub generated via
    # `bundle binstubs puma --path ./sbin` in the WorkingDirectory
    # (replace "<WD>" below)
    WorkingDirectory=/home/deploy/moika/current
    User=deploy
    Group=deploy
    ExecStart=/home/deploy/.rvm/bin/rvm all do bundle exec puma -b tcp://0.0.0.0:3000 -e production
    # Variant: Use config file with `bind` directives instead:
    # ExecStart=<WD>/sbin/puma -C config.rb
    # Variant: Use `bundle exec --keep-file-descriptors puma` instead of binstub

    Restart=always

    [Install]
    WantedBy=multi-user.target