-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[Unit] | ||
Description=Mushroom Observer Puma HTTP Server | ||
After=network.target | ||
|
||
# Uncomment for socket activation (see below) | ||
# Requires=puma.socket | ||
|
||
[Service] | ||
# Puma supports systemd's `Type=notify` and watchdog service | ||
# monitoring, as of Puma 5.1 or later. | ||
# On earlier versions of Puma or JRuby, change this to `Type=simple` and remove | ||
# the `WatchdogSec` line. | ||
Type=notify | ||
|
||
# If your Puma process locks up, systemd's watchdog will restart it within seconds. | ||
WatchdogSec=10 | ||
|
||
# Preferably configure a non-privileged user | ||
# User= | ||
|
||
# The path to your application code root directory. | ||
# Also replace the "<YOUR_APP_PATH>" placeholders below with this path. | ||
# Example /home/username/myapp | ||
WorkingDirectory=/var/web/mo | ||
|
||
PIDFile=/var/web/mo/puma.pid | ||
Environment=RAILS_ENV=production | ||
# Helpful for debugging socket activation, etc. | ||
# Environment=PUMA_DEBUG=1 | ||
|
||
# SystemD will not run puma even if it is in your path. You must specify | ||
# an absolute URL to puma. For example /usr/local/bin/puma | ||
# Alternatively, create a binstub with `bundle binstubs puma --path ./sbin` in the WorkingDirectory | ||
# ExecStart=/<FULLPATH>/bin/puma -C /var/web/mo/puma.rb | ||
|
||
# Variant: Rails start. | ||
# ExecStart=/<FULLPATH>/bin/puma -C /var/web/mo/config/puma.rb ../config.ru | ||
|
||
# Variant: Use `bundle exec puma` instead of binstub | ||
# Variant: Specify directives inline. | ||
# ExecStart=/<FULLPATH>/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem | ||
|
||
# Working example for Rails from the web: | ||
ExecStart=/var/web/mo/bin/bundle exec puma -e production -C ./config/puma.rb config.ru | ||
# For switching to Puma with a rolling restart, replace <USR1> with a different user than the one running Unicorn. | ||
ExecReload=/bin/kill -s $MAINPID | ||
ExecStop=/bin/kill -s QUIT $MAINPID | ||
|
||
Restart=always | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env bash | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
workers Integer(ENV["WEB_CONCURRENCY"] || 3) | ||
threads_count = Integer(ENV["MAX_THREADS"] || 1) | ||
threads threads_count, threads_count | ||
|
||
# preload_app! | ||
prune_bundler | ||
|
||
rackup DefaultRackup if defined?(DefaultRackup) | ||
port ENV["PORT"] || 3000 | ||
environment ENV["RAILS_ENV"] || "production" | ||
|
||
# directory "/var/web/mo" | ||
# redirect_stderr "/var/web/mo/log/puma.stderr.log" | ||
# redirect_stdout "/var/web/mo/log/puma.stdout.log" | ||
# bind "/var/web/mo/tmp/sockets/puma.sock" | ||
# pidfile "/var/web/mo/tmp/pids/puma.pid" | ||
|
||
# on_worker_boot do | ||
# ActiveRecord::Base.establish_connection | ||
# end | ||
|
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