summaryrefslogblamecommitdiffstats
path: root/config/puma.rb
blob: efe7b9be44b9de1e3cc83f785b541eee347563d7 (plain) (tree)
1
2

                   















                                                                             
                                          
                                                        
                                                 

            
                                 
   
 

                    
                                                        
 
                                   
 

                                                                    
 
                                        

                                                                  

                                                                         
 

                                              
 
           


                      
         
#!/usr/bin/env puma

# Band registration form for Norsk Urskog Metal Sampler
# Copyright (C) 2015-2018  Harald Eilersen <haraldei@anduin.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

if @config.environment_str == "production"
  root = File.expand_path('../', File.dirname(__FILE__))
  socket = "unix://#{root}/tmp/sockets/puma.sock"
else
  root = "."
  socket = "tcp://localhost:3000"
end

puts "Root: #{root}"

# Store the pid of the server in the file at “path”.
#
pidfile "#{root}/tmp/pids/puma.pid"

# Use “path” as the file to store the server info state. This is
# used by “pumactl” to query and control the server.
#
state_path "#{root}/tmp/pids/puma.state"

# Redirect STDOUT and STDERR to files specified. The 3rd parameter
# (“append”) specifies whether the output is appended, the default is
# “false”.
#
stdout_redirect "#{root}/log/puma.stdout.log",
                "#{root}/log/puma.stderr.log"

bind socket

# === Cluster mode ===

workers 4