Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@
# terminating a worker in development environments.
worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
port Sagittarius::Configuration.config[:rails][:web][:port]
# Specify either a `bind` or `port` to listen on.
bind_uri = Sagittarius::Configuration.config[:rails][:web][:bind]
port_number = Sagittarius::Configuration.config[:rails][:web][:port]

if bind_uri
bind bind_uri
else
port port_number
end

# Specifies the `environment` that Puma will run in.
environment ENV.fetch('RAILS_ENV', 'development')
Expand Down
1 change: 1 addition & 0 deletions config/sagittarius.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ rails:
password: changeme
web:
port: 3000
bind: # For example: tcp://0.0.0.0:3000
force_ssl:
grpc:
host: '0.0.0.0:50051'
Expand Down
1 change: 1 addition & 0 deletions lib/sagittarius/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def self.defaults
web: {
port: 3000,
force_ssl: nil,
bind: nil,
},
grpc: {
host: '0.0.0.0:50051',
Expand Down