class OdaniaStaticPages::Deploy::DockerCompose::DockerComposeGenerator

Attributes

compose_images[R]
nginx_volume_conf_d[R]
nginx_volume_html[R]
nginx_volume_nginx_conf[R]

Public Class Methods

new(config, environment, nginx_conf_dir) click to toggle source
# 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

Public Instance Methods

render() click to toggle source
# 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) click to toggle source
# File lib/odania_static_pages/deploy/docker_compose.rb, line 107
def write(out_dir)
        File.write out_dir, render
end