Sha256: b72134bcc77f6b1ff735056075f5fe5993a3d70e64602575ee4d6bc3b96b1c5d

Contents?: true

Size: 814 Bytes

Versions: 27

Compression:

Stored size: 814 Bytes

Contents

# frozen_string_literal: true

module Orchestration
  module DockerCompose
    class RabbitMQService
      include ComposeHelpers

      def initialize(config, environment)
        @config = config
        @environment = environment
      end

      def definition
        return nil unless @config.enabled?

        { 'image' => 'library/rabbitmq:management', 'networks' => networks }.merge(ports)
      end

      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
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
orchestration-0.7.15 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.16 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.14 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.13 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.15 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.12 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.14 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.11 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.13 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.10 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.9 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.12 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.8 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.11 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.6 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.10 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.5 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.7.4 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.9 lib/orchestration/docker_compose/rabbitmq_service.rb
orchestration-0.6.8 lib/orchestration/docker_compose/rabbitmq_service.rb