Class: Kuby::Docker::SetupPhase
- Extended by:
- T::Sig
- Defined in:
- lib/kuby/docker/setup_phase.rb
Constant Summary collapse
- DEFAULT_WORKING_DIR =
T.let('/usr/src/app'.freeze, String)
Instance Attribute Summary collapse
-
#base_image ⇒ Object
Returns the value of attribute base_image.
-
#rails_env ⇒ Object
Returns the value of attribute rails_env.
-
#working_dir ⇒ Object
Returns the value of attribute working_dir.
Attributes inherited from Layer
Instance Method Summary collapse
- #apply_to(dockerfile) ⇒ Object
-
#initialize(environment) ⇒ SetupPhase
constructor
A new instance of SetupPhase.
Constructor Details
#initialize(environment) ⇒ SetupPhase
Returns a new instance of SetupPhase.
29 30 31 32 33 34 35 |
# File 'lib/kuby/docker/setup_phase.rb', line 29 def initialize(environment) super @base_image = T.let(@base_image, T.nilable(String)) @working_dir = T.let(@working_dir, T.nilable(String)) @rails_env = T.let(@rails_env, T.nilable(String)) end |
Instance Attribute Details
#base_image ⇒ Object
Returns the value of attribute base_image.
11 12 13 |
# File 'lib/kuby/docker/setup_phase.rb', line 11 def base_image @base_image end |
#rails_env ⇒ Object
Returns the value of attribute rails_env.
23 24 25 |
# File 'lib/kuby/docker/setup_phase.rb', line 23 def rails_env @rails_env end |
#working_dir ⇒ Object
Returns the value of attribute working_dir.
17 18 19 |
# File 'lib/kuby/docker/setup_phase.rb', line 17 def working_dir @working_dir end |
Instance Method Details
#apply_to(dockerfile) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/kuby/docker/setup_phase.rb', line 38 def apply_to(dockerfile) dockerfile.from(base_image || default_base_image) dockerfile.workdir(working_dir || DEFAULT_WORKING_DIR) dockerfile.env("RAILS_ENV=#{rails_env || Kuby.env}") dockerfile.env("KUBY_ENV=#{Kuby.env}") dockerfile.arg('RAILS_MASTER_KEY') end |