File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 2828threads_count = ENV . fetch ( "RAILS_MAX_THREADS" , 3 )
2929threads threads_count , threads_count
3030
31- # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
32- port ENV . fetch ( "PORT" , 3000 )
33-
3431# Allow puma to be restarted by `bin/rails restart` command.
3532plugin :tmp_restart
3633
4138# In other environments, only set the PID file if requested.
4239pidfile ENV [ "PIDFILE" ] if ENV [ "PIDFILE" ]
4340
44- # Production -specific configuration
41+ # Environment -specific configuration
4542if ENV [ "RAILS_ENV" ] == "production"
43+ # Production: Use Unix socket for Nginx reverse proxy
44+ bind "unix://#{ ENV . fetch ( 'PUMA_SOCKET' , 'tmp/sockets/puma.sock' ) } "
45+
4646 # Run 2 worker processes for production
4747 workers ENV . fetch ( "WEB_CONCURRENCY" , 2 )
4848
6161 on_worker_boot do
6262 ActiveRecord ::Base . establish_connection if defined? ( ActiveRecord )
6363 end
64+ else
65+ # Development/Test: Use TCP port
66+ port ENV . fetch ( "PORT" , 3000 )
6467end
You can’t perform that action at this time.
0 commit comments