-
Notifications
You must be signed in to change notification settings - Fork 10
/
template.rb
75 lines (62 loc) · 1.59 KB
/
template.rb
1
2
3
4
5
6
7
8
9
10
11
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
gem 'sidekiq'
gem_group :development, :test do
gem 'pry'
end
after_bundle do
# uncomment_lines 'config/puma.rb', /WEB_CONCURRENCY/
# uncomment_lines 'config/puma.rb', /preload_app/
inject_into_file '.gitignore' do
<<~EOF
/.env
/.cache
/.yarn
/docker/postgres/backup.dump
EOF
end
environment do <<~RUBY
config.i18n.default_locale = :en
config.time_zone = 'UTC'
config.active_job.queue_adapter = :sidekiq
config.generators do |g|
g.assets false
g.helper false
g.jbuilder false
end
RUBY
end
file 'config/sidekiq.yml', <<~EOF
---
:verbose: false
:concurrency: 5
:queues:
- [critical, 2]
- default
- mailers
- low
production:
:concurrency: 5
staging:
:concurrency: 5
EOF
file 'config/initializers/action_mailer.rb', <<~EOF
ActionMailer::Base.default_url_options = {
host: ENV['EMAIL_URL_HOST'],
port: ENV['EMAIL_URL_PORT']
}
if Rails.env.development?
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = { address: 'mail', port: 1025 }
elsif Rails.env.production?
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.smtp_settings = {
:port => ENV['SMTP_PORT'],
:address => ENV['SMTP_SERVER'],
:user_name => ENV['SMTP_USERNAME'],
:password => ENV['SMTP_PASSWORD'],
:domain => ENV['EMAIL_URL_HOST'],
:authentication => :plain
}
end
EOF
end