diff --git a/lib/mrsk/commands/traefik.rb b/lib/mrsk/commands/traefik.rb index 90032e76..b8cbe343 100644 --- a/lib/mrsk/commands/traefik.rb +++ b/lib/mrsk/commands/traefik.rb @@ -1,4 +1,6 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base + CONTAINER_PORT = 80 + def run docker :run, "--name traefik", "--detach", @@ -46,12 +48,15 @@ class Mrsk::Commands::Traefik < Mrsk::Commands::Base end def port - traefik_port = config.raw_config.dig(:traefik, "host_port") || 80 - "#{traefik_port}:80" + "#{host_port}:#{CONTAINER_PORT}" end private def cmd_args (config.raw_config.dig(:traefik, "args") || { }).collect { |(key, value)| [ "--#{key}", value ] }.flatten end + + def host_port + config.raw_config.dig(:traefik, "host_port") || CONTAINER_PORT + end end