Added the additional_ports configuration

ISSUE: https://github.com/mrsked/mrsk/issues/98
This commit is contained in:
Stephen van Beek
2023-03-10 09:39:14 +00:00
parent c282461265
commit 43a1b42f8c
3 changed files with 56 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
"--restart", "unless-stopped",
"--log-opt", "max-size=#{MAX_LOG_SIZE}",
"--publish", port,
*additional_ports,
"--volume", "/var/run/docker.sock:/var/run/docker.sock",
"traefik",
"--providers.docker",
@@ -54,6 +55,14 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
end
private
def additional_ports
if args = config.raw_config.dig(:traefik, "additional_ports")
args.collect { |value| "--publish #{value}:#{value}" }.compact
else
[]
end
end
def cmd_option_args
if args = config.traefik["args"]
optionize args, with: "="