This repository has been archived by the owner on Jun 22, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
template.rb
60 lines (51 loc) · 1.63 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
def source_paths
[__dir__]
end
gem 'ransack'
gem 'platform_agent'
gem 'geared_pagination'
gem 'spreadsheet_architect'
gem_group :production do
gem 'redis'
gem 'sidekiq'
gem 'rack-ratelimit'
gem 'rack-timeout'
end
after_bundle do
run 'spring stop'
run 'yarn add jquery popper.js bootstrap@^4.2.1'\
' @fortawesome/fontawesome-free@^5.7.2'\
' cleave.js@^1.4.7'\
' izitoast@^1.4.0'\
' jquery.nicescroll@^3.7.6'\
' select2@^4.0.7-rc.0'\
' waypoints@^4.0.1'
directory 'app', './app', force: true
directory 'config', './config', force: true
directory 'lib', './lib', force: true
directory 'public', './public', force: true
directory 'test', './test', force: true
directory 'vendor', './vendor', force: true
copy_file 'Procfile', './Procfile'
uncomment_lines 'config/puma.rb', /WEB_CONCURRENCY/
environment do <<~RUBY
config.app = config_for(:config)
config.i18n.default_locale = :en
config.time_zone = 'UTC'
config.generators.scaffold_stylesheet = false
RUBY
end
environment nil, env: 'production' do <<~RUBY
config.force_ssl = true
config.active_job.queue_adapter = :sidekiq
config.action_controller.asset_host = ENV['CLOUDFRONT_URL']
config.cache_store = :redis_cache_store, { url: ENV['REDIS_CACHE_URL'] }
config.middleware.use(
Rack::Ratelimit, name: 'API',
conditions: ->(env) { ActionDispatch::Request.new(env.dup).format.json? },
rate: [50, 10.seconds],
redis: Redis.new
) { |env| ActionDispatch::Request.new(env).ip }
RUBY
end
end