Class: Orchestration::DockerCompose::RabbitMQService
- Inherits:
-
Object
- Object
- Orchestration::DockerCompose::RabbitMQService
- Includes:
- ComposeHelpers
- Defined in:
- lib/orchestration/docker_compose/rabbitmq_service.rb
Instance Method Summary collapse
- #definition ⇒ Object
-
#initialize(config, environment) ⇒ RabbitMQService
constructor
A new instance of RabbitMQService.
- #ports ⇒ Object
Methods included from ComposeHelpers
Constructor Details
#initialize(config, environment) ⇒ RabbitMQService
Returns a new instance of RabbitMQService.
8 9 10 11 |
# File 'lib/orchestration/docker_compose/rabbitmq_service.rb', line 8 def initialize(config, environment) @config = config @environment = environment end |
Instance Method Details
#definition ⇒ Object
13 14 15 16 17 |
# File 'lib/orchestration/docker_compose/rabbitmq_service.rb', line 13 def definition return nil unless @config.enabled? { 'image' => 'library/rabbitmq:management', 'networks' => networks }.merge(ports) end |
#ports ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/orchestration/docker_compose/rabbitmq_service.rb', line 19 def ports return {} unless %i[development test].include?(@environment) container_port = Orchestration::Services::RabbitMQ::PORT management_port = Orchestration::Services::RabbitMQ::MANAGEMENT_PORT { 'ports' => ["#{sidecar_port(@environment)}#{container_port}", "#{sidecar_port(@environment)}#{management_port}"] } end |