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