|
| 1 | +#!/usr/bin/env puma |
| 2 | + |
| 3 | +# Start Puma with next command: |
| 4 | +# RAILS_ENV=production bundle exec puma -C ./config/puma.rb |
| 5 | + |
| 6 | +# uncomment and customize to run in non-root path |
| 7 | +# note that config/gitlab.yml web path should also be changed |
| 8 | +# ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" |
| 9 | + |
| 10 | +application_path = '/home/git/gitlab' |
| 11 | +directory application_path |
| 12 | +environment 'production' |
| 13 | +daemonize true |
| 14 | +pidfile "#{application_path}/tmp/pids/puma.pid" |
| 15 | +state_path "#{application_path}/tmp/pids/puma.state" |
| 16 | +stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" |
| 17 | + |
| 18 | +# Configure “min” to be the minimum number of threads to use to answer |
| 19 | +# requests and “max” the maximum. |
| 20 | +# |
| 21 | +# The default is “0, 16”. |
| 22 | +# |
| 23 | +# threads 0, 16 |
| 24 | + |
| 25 | +# Bind the server to “url”. “tcp://”, “unix://” and “ssl://” are the only |
| 26 | +# accepted protocols. |
| 27 | +# |
| 28 | +# |
| 29 | +# The default is “tcp://0.0.0.0:9292”. |
| 30 | +# |
| 31 | +# bind 'tcp://0.0.0.0:9292' |
| 32 | +# bind 'unix:///var/run/puma.sock' |
| 33 | +# bind 'unix:///var/run/puma.sock?umask=0777' |
| 34 | +# bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert' |
| 35 | +# |
| 36 | +## Comment the next line if you use apache. |
| 37 | +bind "unix://#{application_path}/tmp/sockets/gitlab.socket" |
| 38 | + |
| 39 | +# Instead of “bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'” you |
| 40 | +# can also use the “ssl_bind” option. |
| 41 | +# |
| 42 | +# ssl_bind '127.0.0.1', '9292', { key: path_to_key, cert: path_to_cert } |
| 43 | + |
| 44 | +# Code to run before doing a restart. This code should |
| 45 | +# close log files, database connections, etc. |
| 46 | +# |
| 47 | +# This can be called multiple times to add code each time. |
| 48 | +# |
| 49 | +# on_restart do |
| 50 | +# puts 'On restart...' |
| 51 | +# end |
| 52 | + |
| 53 | +# Command to use to restart puma. This should be just how to |
| 54 | +# load puma itself (ie. 'ruby -Ilib bin/puma'), not the arguments |
| 55 | +# to puma, as those are the same as the original process. |
| 56 | +# |
| 57 | +# restart_command '/u/app/lolcat/bin/restart_puma' |
| 58 | + |
| 59 | +# === Cluster mode === |
| 60 | + |
| 61 | +# How many worker processes to run. |
| 62 | +# |
| 63 | +# The default is “0”. |
| 64 | +# |
| 65 | +# workers 2 |
| 66 | + |
| 67 | +# GitLab cluster mode recommendations |
| 68 | +# If you have more than 1 GB RAM, uncomment one of the following lines: |
| 69 | +# |
| 70 | +# workers 2 # if you have at least 1.5 GB RAM |
| 71 | +# workers 3 # if you have at least 2 GB RAM |
| 72 | +# workers 4 # if you have at least 2.5 GB RAM |
| 73 | + |
| 74 | +# Code to run when a worker boots to setup the process before booting |
| 75 | +# the app. |
| 76 | +# |
| 77 | +# This can be called multiple times to add hooks. |
| 78 | +# |
| 79 | +# on_worker_boot do |
| 80 | +# puts 'On worker boot...' |
| 81 | +# end |
| 82 | + |
| 83 | +# === Puma control rack application === |
| 84 | + |
| 85 | +# Start the puma control rack application on “url”. This application can |
| 86 | +# be communicated with to control the main server. Additionally, you can |
| 87 | +# provide an authentication token, so all requests to the control server |
| 88 | +# will need to include that token as a query parameter. This allows for |
| 89 | +# simple authentication. |
| 90 | +# |
| 91 | +# Check out https://github.com/puma/puma/blob/master/lib/puma/app/status.rb |
| 92 | +# to see what the app has available. |
| 93 | +# |
| 94 | +# activate_control_app 'unix:///var/run/pumactl.sock' |
| 95 | +# activate_control_app 'unix:///var/run/pumactl.sock', { auth_token: '12345' } |
| 96 | +# activate_control_app 'unix:///var/run/pumactl.sock', { no_token: true } |
0 commit comments