10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/generators/modulorails/docker/docker_generator.rb', line 10
def create_config_file
@data = Modulorails.data
@adapter = @data.adapter
@webpack_container_needed = @data.webpacker_version.present?
@image_name = @data.name.parameterize
@environment_name = @data.environment_name
template 'Dockerfile'
template 'Dockerfile.prod'
template 'docker-compose.yml'
template 'docker-compose.prod.yml'
template 'entrypoints/docker-entrypoint.sh'
chmod 'entrypoints/docker-entrypoint.sh', 0755
template 'config/database.yml'
template 'config/cable.yml'
if @webpack_container_needed
template 'entrypoints/webpack-entrypoint.sh'
chmod 'entrypoints/webpack-entrypoint.sh', 0755
end
rescue StandardError => e
warn("[Modulorails] Error: cannot generate Docker configuration: #{e.message}")
end
|