Class: Kuby::Docker::SetupPhase

Inherits:
Phase
  • Object
show all
Defined in:
lib/kuby/docker/setup_phase.rb

Constant Summary collapse

DEFAULT_WORKING_DIR =
'/usr/src/app'.freeze

Instance Attribute Summary collapse

Attributes inherited from Phase

#definition

Instance Method Summary collapse

Methods inherited from Phase

#initialize

Constructor Details

This class inherits a constructor from Kuby::Docker::Phase

Instance Attribute Details

#base_imageObject

Returns the value of attribute base_image.



6
7
8
# File 'lib/kuby/docker/setup_phase.rb', line 6

def base_image
  @base_image
end

#working_dirObject

Returns the value of attribute working_dir.



6
7
8
# File 'lib/kuby/docker/setup_phase.rb', line 6

def working_dir
  @working_dir
end

Instance Method Details

#apply_to(dockerfile) ⇒ Object



8
9
10
11
12
13
# File 'lib/kuby/docker/setup_phase.rb', line 8

def apply_to(dockerfile)
  dockerfile.from(base_image || default_base_image)
  dockerfile.workdir(working_dir || DEFAULT_WORKING_DIR)
  dockerfile.env("RAILS_ENV=#{Kuby.env}")
  dockerfile.env("KUBY_ENV=#{Kuby.env}")
end