Added network_args to proxy configuration
This commit is contained in:
@@ -4,7 +4,7 @@ class Kamal::Commands::Proxy < Kamal::Commands::Base
|
||||
def run
|
||||
docker :run,
|
||||
"--name", container_name,
|
||||
"--network", "kamal",
|
||||
*config.network_args,
|
||||
"--detach",
|
||||
"--restart", "unless-stopped",
|
||||
"--volume", "kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy",
|
||||
|
||||
@@ -3,6 +3,7 @@ class Kamal::Configuration::Proxy
|
||||
|
||||
DEFAULT_LOG_REQUEST_HEADERS = [ "Cache-Control", "Last-Modified", "User-Agent" ]
|
||||
CONTAINER_NAME = "kamal-proxy"
|
||||
NETWORK = "kamal"
|
||||
|
||||
delegate :argumentize, :optionize, to: Kamal::Utils
|
||||
|
||||
@@ -51,6 +52,10 @@ class Kamal::Configuration::Proxy
|
||||
optionize ({ target: "#{target}:#{app_port}" }).merge(deploy_options), with: "="
|
||||
end
|
||||
|
||||
def network_args
|
||||
argumentize "--network", network
|
||||
end
|
||||
|
||||
def merge(other)
|
||||
self.class.new config: config, proxy_config: proxy_config.deep_merge(other.proxy_config)
|
||||
end
|
||||
@@ -59,4 +64,8 @@ class Kamal::Configuration::Proxy
|
||||
def seconds_duration(value)
|
||||
value ? "#{value}s" : nil
|
||||
end
|
||||
|
||||
def network
|
||||
proxy_config["network"] || NETWORK
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user