12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/generators/modulorails/docker/docker_generator.rb', line 12
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 'entrypoints/docker-entrypoint.sh'
chmod 'entrypoints/docker-entrypoint.sh', 0755
template 'config/database.yml'
template 'config/cable.yml'
template 'config/initializers/0_redis.rb'
template 'config/puma.rb'
return unless @webpack_container_needed
template 'entrypoints/webpack-entrypoint.sh'
chmod 'entrypoints/webpack-entrypoint.sh', 0755
create_keep_file
rescue StandardError => e
warn("[Modulorails] Error: cannot generate Docker configuration: #{e.message}")
end
|