Skip to content

Commit

Permalink
fixed puma.rb file
Browse files Browse the repository at this point in the history
  • Loading branch information
ParzivalRealm committed Feb 25, 2023
1 parent 701222c commit 3b2f164
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,31 @@
# or
# RAILS_ENV=development bundle exec puma -C ./config/puma.rb

#!/usr/bin/env puma

# Define variables for the application path and environment.
application_path = Rails.root
railsenv = ENV['RAILS_ENV'] || 'production'
rails_env = ENV['RAILS_ENV'] || 'production'

# Configure the application path, environment, and daemonization.
directory application_path
environment railsenv
environment rails_env
daemonize true
pidfile "#{application_path}/tmp/pids/puma-#{railsenv}.pid"
state_path "#{application_path}/tmp/pids/puma-#{railsenv}.state"

# Set the location of the PID and state files.
pidfile "#{application_path}/tmp/pids/puma-#{rails_env}.pid"
state_path "#{application_path}/tmp/pids/puma-#{rails_env}.state"

# Set the locations for standard output and error logs.
stdout_redirect "#{application_path}/log/puma-#{rails_env}.stdout.log",
"#{application_path}/log/puma-#{rails_env}.stderr.log", true

# Set the number of threads to use.
threads 0, 16
bind "unix://#{application_path}/tmp/sockets/#{railsenv}.socket"

# Bind to a Unix domain socket and use nginx as a reverse proxy.
bind "unix://#{application_path}/tmp/sockets/#{rails_env}.socket"
bind "tcp://127.0.0.1:8080"

# Allow puma to be restarted by touch command.
restart_command 'touch tmp/restart.txt'

0 comments on commit 3b2f164

Please sign in to comment.