Sha256: bcd5e21cf3de660ccd53da8885e59d5b824c85ec52525def990f5c3764f65051

Contents?: true

Size: 641 Bytes

Versions: 14

Compression:

Stored size: 641 Bytes

Contents

# frozen_string_literal: true

module Orchestration
  module DockerCompose
    class RabbitMQService
      def initialize(config, environment)
        @config = config
        @environment = environment
      end

      def definition
        return nil if @config.settings.nil?

        { 'image' => 'library/rabbitmq' }.merge(ports)
      end

      def ports
        return {} unless %i[development test].include?(@environment)

        host_port = @config.settings.fetch('port', 5672)
        container_port = Orchestration::Services::RabbitMQ::PORT

        { 'ports' => ["#{host_port}:#{container_port}"] }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
orchestration-0.3.17 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.16 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.15 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.14 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.13 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.12 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.11 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.10 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.9 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.8 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.7 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.6 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.5 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.3.4 lib/orchestration/docker_compose/rabbitmq_service.rb