Added ability to override default Traefik command line arguments

This commit is contained in:
Igor Alexandrov
2023-06-05 10:29:40 +04:00
parent cd5c41ddbe
commit d9b3fac17a
2 changed files with 27 additions and 17 deletions

View File

@@ -3,6 +3,9 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
DEFAULT_IMAGE = "traefik:v2.9"
CONTAINER_PORT = 80
DEFAULT_ARGS = {
'log.level' => 'DEBUG'
}
def run
docker :run, "--name traefik",
@@ -16,7 +19,6 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
*docker_options_args,
image,
"--providers.docker",
"--log.level=DEBUG",
*cmd_option_args
end
@@ -86,9 +88,9 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base
def cmd_option_args
if args = config.traefik["args"]
optionize args, with: "="
optionize DEFAULT_ARGS.merge(args), with: "="
else
[]
optionize DEFAULT_ARGS, with: "="
end
end