Created
August 23, 2018 20:38
-
-
Save chadwilken/e072871d8f0edd5b4708b3cf24b48de5 to your computer and use it in GitHub Desktop.
Puma Systemd service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Puma HTTP Server for <%= "#{fetch(:application)} (#{fetch(:stage)})" %> | |
After=network.target | |
Requires=puma.socket | |
[Service] | |
Type=simple | |
User=<%= fetch(:deploy_user) %> | |
Environment=RAILS_ENV=<%= fetch(:rails_env) %> | |
# Helpful for debugging socket activation, etc. | |
# Environment=PUMA_DEBUG=1 | |
# The path to the puma application root | |
WorkingDirectory=<%= current_path %> | |
ExecStart=/bin/bash -lc '<%= shared_path %>/bin/puma -C <%= fetch(:puma_conf) %>' | |
# Path to PID file so that systemd knows which is the master process | |
PIDFile=<%= fetch(:puma_pid) %> | |
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