Set port
This commit is contained in:
@@ -48,7 +48,7 @@ class Kamal::Cli::App::Boot
|
||||
audit "Booted app version #{version}"
|
||||
execute *app.run(hostname: "#{host}-#{SecureRandom.hex(6)}")
|
||||
if running_proxy?
|
||||
execute *KAMAL.proxy.deploy(app.container_name(version))
|
||||
execute *KAMAL.proxy.deploy("#{app.container_name(version)}:#{role.port}")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require "erb"
|
||||
require "net/ssh/proxy/jump"
|
||||
|
||||
class Kamal::Configuration
|
||||
delegate :service, :image, :servers, :labels, :registry, :stop_wait_time, :hooks_path, :logging, to: :raw_config, allow_nil: true
|
||||
delegate :service, :image, :port, :servers, :labels, :registry, :stop_wait_time, :hooks_path, :logging, to: :raw_config, allow_nil: true
|
||||
delegate :argumentize, :optionize, to: Kamal::Utils
|
||||
|
||||
attr_reader :destination, :raw_config
|
||||
|
||||
@@ -16,6 +16,10 @@ class Kamal::Configuration::Role
|
||||
@hosts ||= extract_hosts_from_config
|
||||
end
|
||||
|
||||
def port
|
||||
specializations["port"] || config.port || "3000"
|
||||
end
|
||||
|
||||
def cmd
|
||||
specializations["cmd"]
|
||||
end
|
||||
|
||||
@@ -3,6 +3,7 @@ image: app
|
||||
servers:
|
||||
- vm1
|
||||
- vm2
|
||||
port: 80
|
||||
env:
|
||||
clear:
|
||||
CLEAR_TOKEN: 4321
|
||||
|
||||
@@ -9,6 +9,7 @@ servers:
|
||||
hosts:
|
||||
- vm3
|
||||
cmd: sleep infinity
|
||||
port: 80
|
||||
|
||||
asset_path: /usr/share/nginx/html/versions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user