Use Volume for kamal proxy config volume
This commit is contained in:
@@ -17,7 +17,7 @@ class Kamal::Commands::Proxy < Kamal::Commands::Base
|
||||
"--restart", "unless-stopped",
|
||||
*proxy_config.publish_args,
|
||||
"--volume", "/var/run/docker.sock:/var/run/docker.sock",
|
||||
"--volume", "#{proxy_config.config_directory_as_docker_volume}:/root/.config/kamal-proxy",
|
||||
*proxy_config.config_volume.docker_args,
|
||||
*config.logging_args,
|
||||
proxy_config.image
|
||||
end
|
||||
|
||||
@@ -207,10 +207,6 @@ class Kamal::Configuration
|
||||
end
|
||||
|
||||
|
||||
def run_directory_as_docker_volume
|
||||
File.join "$(pwd)", run_directory
|
||||
end
|
||||
|
||||
def hooks_path
|
||||
raw_config.hooks_path || ".kamal/hooks"
|
||||
end
|
||||
|
||||
@@ -59,8 +59,10 @@ class Kamal::Configuration::Proxy
|
||||
optionize deploy_options
|
||||
end
|
||||
|
||||
def config_directory_as_docker_volume
|
||||
File.join config.run_directory_as_docker_volume, "proxy", "config"
|
||||
def config_volume
|
||||
Kamal::Configuration::Volume.new \
|
||||
host_path: File.join(config.run_directory, "proxy", "config"),
|
||||
container_path: "/root/.config/kamal-proxy"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user