Add a writable proxy volume

Maps in and external /home/kamal-proxy/.app-config volume that we can
use to map files to the proxy.

Can be used to store custom maintenance pages or SSL certificates.
This commit is contained in:
Donal McBreen
2025-04-15 13:51:34 +01:00
parent 3c1fbb41cb
commit 26b6c072f3
4 changed files with 16 additions and 5 deletions

View File

@@ -109,6 +109,7 @@ class Kamal::Commands::Proxy < Kamal::Commands::Base
"--network", "kamal",
"--detach",
"--restart", "unless-stopped",
"--volume", "kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy"
"--volume", "kamal-proxy-config:/home/kamal-proxy/.config/kamal-proxy",
*config.proxy_app_config_volume.docker_args
end
end

View File

@@ -300,6 +300,16 @@ class Kamal::Configuration
File.join proxy_directory, "image_version"
end
def proxy_app_config_directory
File.join proxy_directory, "app-config"
end
def proxy_app_config_volume
Volume.new \
host_path: proxy_app_config_directory,
container_path: "/home/kamal-proxy/.app-config"
end
def to_h
{
roles: role_names,