Sha256: fa714e7343766f5e6bbc562abbb27f0ff3a31e126d5441586fe3b1f046b3834c

Contents?: true

Size: 948 Bytes

Versions: 6

Compression:

Stored size: 948 Bytes

Contents

# frozen_string_literal: true

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

      def definition
        {
          'image' => '${DOCKER_ORGANIZATION}/${DOCKER_REPOSITORY}',
          'environment' => environment
        }
      end

      private

      def environment
        {
          'RAILS_LOG_TO_STDOUT' => '1',
          'RAILS_SERVE_STATIC_FILES' => '1',
          'UNICORN_PRELOAD_APP' => '1',
          'UNICORN_TIMEOUT' => '60',
          'UNICORN_WORKER_PROCESSES' => '8',
          'SERVICE_PORTS' => '8080'
        }.merge(inherited_environment)
      end

      def inherited_environment
        {
          'DATABASE_URL' => nil,
          'HOST_UID' => nil,
          'RAILS_ENV' => nil,
          'SECRET_KEY_BASE' => nil,
          'VIRTUAL_HOST' => nil
        }
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
orchestration-0.3.14 lib/orchestration/docker_compose/app_service.rb
orchestration-0.3.13 lib/orchestration/docker_compose/app_service.rb
orchestration-0.3.12 lib/orchestration/docker_compose/app_service.rb
orchestration-0.3.11 lib/orchestration/docker_compose/app_service.rb
orchestration-0.3.10 lib/orchestration/docker_compose/app_service.rb
orchestration-0.3.9 lib/orchestration/docker_compose/app_service.rb