This commit is contained in:
Donal McBreen
2024-03-28 15:43:08 +00:00
parent d47912572c
commit c93588713b
5 changed files with 8 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -3,6 +3,7 @@ image: app
servers:
- vm1
- vm2
port: 80
env:
clear:
CLEAR_TOKEN: 4321

View File

@@ -9,6 +9,7 @@ servers:
hosts:
- vm3
cmd: sleep infinity
port: 80
asset_path: /usr/share/nginx/html/versions