2014-02-06 13:15:00 -06:00
|
|
|
#!/usr/bin/env ruby
|
2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
2018-08-07 02:13:20 -05:00
|
|
|
|
2018-08-09 09:14:45 -05:00
|
|
|
if !ENV["RAILS_ENV"] && (ARGV[0] == "s" || ARGV[0] == "server")
|
2018-08-14 19:25:00 -05:00
|
|
|
ENV["UNICORN_PORT"] ||= "3000"
|
|
|
|
|
|
|
|
if ARGV[1] == "-p" && (port = ARGV[2].to_i) > 0
|
|
|
|
ENV["UNICORN_PORT"] = port.to_s
|
|
|
|
end
|
|
|
|
|
2018-08-13 17:49:57 -05:00
|
|
|
ENV["RAILS_LOGS_STDOUT"] ||= "1"
|
2021-04-30 05:50:06 -05:00
|
|
|
|
|
|
|
STDERR.puts <<~MESSAGE
|
|
|
|
--------
|
|
|
|
WARNING: Discourse uses `bin/unicorn` to start the web server.
|
|
|
|
For backwards compatibility, `rails s` will do this automatically.
|
|
|
|
For improved performance you should run `bin/unicorn` directly.
|
|
|
|
|
|
|
|
Running:
|
|
|
|
UNICORN_PORT=#{ENV["UNICORN_PORT"]} RAILS_LOGS_STDOUT=#{ENV["RAILS_LOGS_STDOUT"]} bin/unicorn
|
|
|
|
--------
|
|
|
|
MESSAGE
|
|
|
|
|
2018-08-07 02:13:20 -05:00
|
|
|
exec File.expand_path("unicorn", __dir__)
|
|
|
|
end
|
|
|
|
|
2017-08-30 23:06:56 -05:00
|
|
|
APP_PATH = File.expand_path('../config/application', __dir__)
|
2015-04-16 01:15:04 -05:00
|
|
|
require_relative '../config/boot'
|
|
|
|
require 'rails/commands'
|