Class: OdaniaStaticPages::Deploy::DockerCompose::DockerComposeGenerator
- Inherits:
-
Object
- Object
- OdaniaStaticPages::Deploy::DockerCompose::DockerComposeGenerator
- Defined in:
- lib/odania_static_pages/deploy/docker_compose.rb
Instance Attribute Summary collapse
-
#compose_images ⇒ Object
readonly
Returns the value of attribute compose_images.
-
#nginx_volume_conf_d ⇒ Object
readonly
Returns the value of attribute nginx_volume_conf_d.
-
#nginx_volume_html ⇒ Object
readonly
Returns the value of attribute nginx_volume_html.
-
#nginx_volume_nginx_conf ⇒ Object
readonly
Returns the value of attribute nginx_volume_nginx_conf.
Instance Method Summary collapse
-
#initialize(config, environment, nginx_conf_dir) ⇒ DockerComposeGenerator
constructor
A new instance of DockerComposeGenerator.
- #render ⇒ Object
- #write(out_dir) ⇒ Object
Constructor Details
#initialize(config, environment, nginx_conf_dir) ⇒ DockerComposeGenerator
Returns a new instance of DockerComposeGenerator.
95 96 97 98 99 100 101 |
# File 'lib/odania_static_pages/deploy/docker_compose.rb', line 95 def initialize(config, environment, nginx_conf_dir) @nginx_volume_html = "#{config.output_site_path}:/srv:ro" @nginx_volume_conf_d = "#{nginx_conf_dir}:/etc/nginx/conf.d:ro" @nginx_volume_nginx_conf = "#{File.join(config.output_path, 'nginx', 'nginx.conf')}:/etc/nginx/nginx.conf" @compose_images = environment.deploy_module.compose_images @erb_template = File.join(config.base_dir, 'templates', 'docker-compose', 'docker-compose.yml.erb') end |
Instance Attribute Details
#compose_images ⇒ Object (readonly)
Returns the value of attribute compose_images.
93 94 95 |
# File 'lib/odania_static_pages/deploy/docker_compose.rb', line 93 def compose_images @compose_images end |
#nginx_volume_conf_d ⇒ Object (readonly)
Returns the value of attribute nginx_volume_conf_d.
93 94 95 |
# File 'lib/odania_static_pages/deploy/docker_compose.rb', line 93 def nginx_volume_conf_d @nginx_volume_conf_d end |
#nginx_volume_html ⇒ Object (readonly)
Returns the value of attribute nginx_volume_html.
93 94 95 |
# File 'lib/odania_static_pages/deploy/docker_compose.rb', line 93 def nginx_volume_html @nginx_volume_html end |
#nginx_volume_nginx_conf ⇒ Object (readonly)
Returns the value of attribute nginx_volume_nginx_conf.
93 94 95 |
# File 'lib/odania_static_pages/deploy/docker_compose.rb', line 93 def nginx_volume_nginx_conf @nginx_volume_nginx_conf end |
Instance Method Details
#render ⇒ Object
103 104 105 |
# File 'lib/odania_static_pages/deploy/docker_compose.rb', line 103 def render ERB.new(File.read(@erb_template)).result(binding) end |
#write(out_dir) ⇒ Object
107 108 109 |
# File 'lib/odania_static_pages/deploy/docker_compose.rb', line 107 def write(out_dir) File.write out_dir, render end |