summaryrefslogtreecommitdiffstats
path: root/config/puma.rb
blob: 62073b5d05071ca7bce577f93d0c78db9c25679b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env puma

if get(:environment) == "production"
  root = "../../shared"
else
  root = "."
end

# 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"

if get(:environment) == "production"
  bind "unix://../../shared/tmp/sockets/puma.sock"
else
  bind "tcp://localhost:3000"
end

# === Cluster mode ===

workers 4