orats 0.9.7 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -2
  3. data/.rubocop.yml +24 -0
  4. data/.travis.yml +9 -0
  5. data/README.md +103 -194
  6. data/bin/orats +2 -5
  7. data/lib/orats/cli.rb +6 -67
  8. data/lib/orats/cli_help/destroy +11 -0
  9. data/lib/orats/cli_help/new +2 -26
  10. data/lib/orats/commands/new.rb +127 -0
  11. data/lib/orats/common.rb +0 -29
  12. data/lib/orats/templates/base/.dockerignore +5 -0
  13. data/lib/orats/templates/base/.gitignore +22 -0
  14. data/lib/orats/templates/base/.rubocop.yml +29 -0
  15. data/lib/orats/templates/base/Dockerfile +102 -0
  16. data/lib/orats/templates/base/Gemfile +69 -0
  17. data/lib/orats/templates/base/Gemfile.lock +205 -0
  18. data/lib/orats/templates/base/README.md +24 -0
  19. data/lib/orats/templates/base/Rakefile +7 -0
  20. data/lib/orats/templates/base/app/assets/config/manifest.js +3 -0
  21. data/lib/orats/templates/base/app/assets/images/.keep +0 -0
  22. data/lib/orats/templates/base/app/assets/javascripts/application.js +33 -0
  23. data/lib/orats/templates/base/app/assets/javascripts/cable.js +14 -0
  24. data/lib/orats/templates/base/app/assets/javascripts/channels/.keep +0 -0
  25. data/lib/orats/templates/base/app/assets/stylesheets/application.scss +89 -0
  26. data/lib/orats/templates/base/app/channels/application_cable/channel.rb +4 -0
  27. data/lib/orats/templates/base/app/channels/application_cable/connection.rb +4 -0
  28. data/lib/orats/templates/base/app/controllers/application_controller.rb +3 -0
  29. data/lib/orats/templates/base/app/controllers/concerns/.keep +0 -0
  30. data/lib/orats/templates/base/app/controllers/pages_controller.rb +4 -0
  31. data/lib/orats/templates/base/app/helpers/application_helper.rb +31 -0
  32. data/lib/orats/templates/base/app/helpers/pages_helper.rb +2 -0
  33. data/lib/orats/templates/base/app/jobs/application_job.rb +2 -0
  34. data/lib/orats/templates/base/app/mailers/application_mailer.rb +4 -0
  35. data/lib/orats/templates/base/app/models/application_record.rb +3 -0
  36. data/lib/orats/templates/base/app/models/concerns/.keep +0 -0
  37. data/lib/orats/templates/{includes/new/rails → base}/app/views/layouts/_flash.html.erb +1 -1
  38. data/lib/orats/templates/base/app/views/layouts/_footer.html.erb +3 -0
  39. data/lib/orats/templates/{includes/new/rails/app/views/layouts/_google_analytics_snippet.html.erb → base/app/views/layouts/_google_analytics.html.erb} +5 -9
  40. data/lib/orats/templates/{includes/new/rails → base}/app/views/layouts/_navigation.html.erb +5 -4
  41. data/lib/orats/templates/base/app/views/layouts/application.html.erb +48 -0
  42. data/lib/orats/templates/base/app/views/layouts/mailer.html.erb +13 -0
  43. data/lib/orats/templates/base/app/views/layouts/mailer.text.erb +1 -0
  44. data/lib/orats/templates/base/app/views/pages/home.html.erb +46 -0
  45. data/lib/orats/templates/base/bin/bundle +3 -0
  46. data/lib/orats/templates/base/bin/rails +4 -0
  47. data/lib/orats/templates/base/bin/rake +4 -0
  48. data/lib/orats/templates/base/bin/setup +34 -0
  49. data/lib/orats/templates/base/bin/update +29 -0
  50. data/lib/orats/templates/base/cable/config.ru +4 -0
  51. data/lib/orats/templates/base/config.ru +5 -0
  52. data/lib/orats/templates/base/config/application.rb +71 -0
  53. data/lib/orats/templates/base/config/boot.rb +3 -0
  54. data/lib/orats/templates/base/config/cable.yml +14 -0
  55. data/lib/orats/templates/base/config/database.yml +13 -0
  56. data/lib/orats/templates/base/config/environment.rb +5 -0
  57. data/lib/orats/templates/base/config/environments/development.rb +49 -0
  58. data/lib/orats/templates/base/config/environments/production.rb +56 -0
  59. data/lib/orats/templates/base/config/environments/staging.rb +6 -0
  60. data/lib/orats/templates/base/config/environments/test.rb +40 -0
  61. data/lib/orats/templates/base/config/initializers/application_controller_renderer.rb +6 -0
  62. data/lib/orats/templates/base/config/initializers/assets.rb +12 -0
  63. data/lib/orats/templates/base/config/initializers/backtrace_silencers.rb +9 -0
  64. data/lib/orats/templates/base/config/initializers/cookies_serializer.rb +5 -0
  65. data/lib/orats/templates/base/config/initializers/filter_parameter_logging.rb +4 -0
  66. data/lib/orats/templates/base/config/initializers/inflections.rb +16 -0
  67. data/lib/orats/templates/base/config/initializers/mime_types.rb +4 -0
  68. data/lib/orats/templates/base/config/initializers/new_framework_defaults.rb +27 -0
  69. data/lib/orats/templates/base/config/initializers/session_store.rb +4 -0
  70. data/lib/orats/templates/{includes/new/rails → base}/config/initializers/sidekiq.rb +1 -4
  71. data/lib/orats/templates/base/config/initializers/timeout.rb +1 -0
  72. data/lib/orats/templates/base/config/initializers/wrap_parameters.rb +15 -0
  73. data/lib/orats/templates/base/config/locales/en.yml +23 -0
  74. data/lib/orats/templates/base/config/puma.rb +60 -0
  75. data/lib/orats/templates/base/config/routes.rb +3 -0
  76. data/lib/orats/templates/{includes/new/rails → base}/config/secrets.yml +3 -2
  77. data/lib/orats/templates/base/config/sidekiq.yml.erb +5 -0
  78. data/lib/orats/templates/base/config/spring.rb +6 -0
  79. data/lib/orats/templates/base/db/seeds.rb +9 -0
  80. data/lib/orats/templates/base/docker-compose.yml +59 -0
  81. data/lib/orats/templates/base/lib/assets/.keep +0 -0
  82. data/lib/orats/templates/base/lib/tasks/.keep +0 -0
  83. data/lib/orats/templates/base/log/.keep +0 -0
  84. data/lib/orats/templates/base/public/404.html +67 -0
  85. data/lib/orats/templates/base/public/422.html +67 -0
  86. data/lib/orats/templates/base/public/500.html +66 -0
  87. data/lib/orats/templates/base/public/apple-touch-icon-precomposed.png +0 -0
  88. data/lib/orats/templates/base/public/apple-touch-icon.png +0 -0
  89. data/lib/orats/templates/base/public/favicon.ico +0 -0
  90. data/lib/orats/templates/base/public/robots.txt +5 -0
  91. data/lib/orats/templates/base/test/controllers/.keep +0 -0
  92. data/lib/orats/templates/base/test/controllers/pages_controller_test.rb +9 -0
  93. data/lib/orats/templates/base/test/fixtures/.keep +0 -0
  94. data/lib/orats/templates/base/test/fixtures/files/.keep +0 -0
  95. data/lib/orats/templates/base/test/helpers/.keep +0 -0
  96. data/lib/orats/templates/base/test/integration/.keep +0 -0
  97. data/lib/orats/templates/base/test/mailers/.keep +0 -0
  98. data/lib/orats/templates/base/test/models/.keep +0 -0
  99. data/lib/orats/templates/base/test/test_helper.rb +11 -0
  100. data/lib/orats/templates/base/tmp/.keep +0 -0
  101. data/lib/orats/templates/base/vendor/assets/javascripts/.keep +0 -0
  102. data/lib/orats/templates/base/vendor/assets/stylesheets/.keep +0 -0
  103. data/lib/orats/ui.rb +5 -5
  104. data/lib/orats/util.rb +14 -0
  105. data/lib/orats/version.rb +1 -1
  106. data/orats.gemspec +3 -2
  107. data/test/integration/cli_test.rb +43 -65
  108. data/test/test_helper.rb +9 -58
  109. metadata +114 -66
  110. data/lib/orats/argv_adjust.rb +0 -61
  111. data/lib/orats/cli_help/nuke +0 -19
  112. data/lib/orats/commands/new/exec.rb +0 -59
  113. data/lib/orats/commands/new/rails.rb +0 -215
  114. data/lib/orats/commands/new/server.rb +0 -67
  115. data/lib/orats/commands/nuke.rb +0 -108
  116. data/lib/orats/postgres.rb +0 -92
  117. data/lib/orats/process.rb +0 -35
  118. data/lib/orats/redis.rb +0 -25
  119. data/lib/orats/shell.rb +0 -12
  120. data/lib/orats/templates/auth.rb +0 -394
  121. data/lib/orats/templates/base.rb +0 -546
  122. data/lib/orats/templates/includes/common/.gitignore +0 -6
  123. data/lib/orats/templates/includes/common/LICENSE +0 -22
  124. data/lib/orats/templates/includes/new/rails/.env +0 -59
  125. data/lib/orats/templates/includes/new/rails/Gemfile +0 -48
  126. data/lib/orats/templates/includes/new/rails/Procfile +0 -3
  127. data/lib/orats/templates/includes/new/rails/README.md +0 -3
  128. data/lib/orats/templates/includes/new/rails/app/assets/favicon/favicon_base.png +0 -0
  129. data/lib/orats/templates/includes/new/rails/app/helpers/application_helper.rb +0 -53
  130. data/lib/orats/templates/includes/new/rails/app/models/account.rb +0 -40
  131. data/lib/orats/templates/includes/new/rails/app/views/devise/confirmations/new.html.erb +0 -26
  132. data/lib/orats/templates/includes/new/rails/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
  133. data/lib/orats/templates/includes/new/rails/app/views/devise/mailer/reset_password_instructions.html.erb +0 -10
  134. data/lib/orats/templates/includes/new/rails/app/views/devise/mailer/unlock_instructions.html.erb +0 -8
  135. data/lib/orats/templates/includes/new/rails/app/views/devise/passwords/edit.html.erb +0 -28
  136. data/lib/orats/templates/includes/new/rails/app/views/devise/passwords/new.html.erb +0 -26
  137. data/lib/orats/templates/includes/new/rails/app/views/devise/registrations/edit.html.erb +0 -51
  138. data/lib/orats/templates/includes/new/rails/app/views/devise/registrations/new.html.erb +0 -31
  139. data/lib/orats/templates/includes/new/rails/app/views/devise/sessions/new.html.erb +0 -39
  140. data/lib/orats/templates/includes/new/rails/app/views/devise/shared/_links.html.erb +0 -38
  141. data/lib/orats/templates/includes/new/rails/app/views/devise/unlocks/new.html.erb +0 -26
  142. data/lib/orats/templates/includes/new/rails/app/views/layouts/_disqus_comments_snippet.html.erb +0 -19
  143. data/lib/orats/templates/includes/new/rails/app/views/layouts/_disqus_count_snippet.html.erb +0 -12
  144. data/lib/orats/templates/includes/new/rails/app/views/layouts/_footer.html.erb +0 -2
  145. data/lib/orats/templates/includes/new/rails/app/views/layouts/_navigation_auth.html.erb +0 -15
  146. data/lib/orats/templates/includes/new/rails/app/views/layouts/_navigation_links.html.erb +0 -3
  147. data/lib/orats/templates/includes/new/rails/app/views/layouts/application.html.erb +0 -47
  148. data/lib/orats/templates/includes/new/rails/app/views/pages/home.html.erb +0 -58
  149. data/lib/orats/templates/includes/new/rails/config/database.yml +0 -6
  150. data/lib/orats/templates/includes/new/rails/config/environments/staging.rb +0 -5
  151. data/lib/orats/templates/includes/new/rails/config/initializers/devise_async.rb +0 -1
  152. data/lib/orats/templates/includes/new/rails/config/initializers/mini_profiler.rb +0 -4
  153. data/lib/orats/templates/includes/new/rails/config/puma.rb +0 -39
  154. data/lib/orats/templates/includes/new/rails/config/schedule.rb +0 -3
  155. data/lib/orats/templates/includes/new/rails/config/sidekiq.yml +0 -7
  156. data/lib/orats/templates/includes/new/rails/config/sitemap.rb +0 -20
  157. data/lib/orats/templates/includes/new/rails/config/unicorn.rb +0 -84
  158. data/lib/orats/templates/includes/new/rails/lib/tasks/orats/favicon.rake +0 -48
  159. data/lib/orats/templates/includes/new/rails/public/404.html +0 -13
  160. data/lib/orats/templates/includes/new/rails/public/422.html +0 -13
  161. data/lib/orats/templates/includes/new/rails/public/500.html +0 -13
  162. data/lib/orats/templates/includes/new/rails/public/502.html +0 -13
  163. data/lib/orats/templates/includes/new/rails/public/deploy.html +0 -14
  164. data/lib/orats/templates/includes/new/rails/test/fixtures/accounts.yml +0 -27
  165. data/lib/orats/templates/includes/new/rails/test/models/account_test.rb +0 -46
@@ -0,0 +1,56 @@
1
+ Rails.application.configure do
2
+ # Code is not reloaded between requests.
3
+ config.cache_classes = true
4
+
5
+ # Eager load code on boot. This eager loads most of Rails and
6
+ # your application in memory, allowing both threaded web servers
7
+ # and those relying on copy on write to perform better.
8
+ # Rake tasks automatically ignore this option for performance.
9
+ config.eager_load = true
10
+
11
+ # Full error reports are disabled and caching is turned on.
12
+ config.consider_all_requests_local = false
13
+ config.action_controller.perform_caching = true
14
+
15
+ # Disable serving static files from the `/public` folder by default since
16
+ # Apache or NGINX already handles this.
17
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
18
+
19
+ # Compress JavaScripts and CSS.
20
+ config.assets.js_compressor = :uglifier
21
+ # config.assets.css_compressor = :sass
22
+
23
+ # Do not fallback to assets pipeline if a pre-compiled asset is missed.
24
+ config.assets.compile = false
25
+
26
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
27
+ # config.action_controller.asset_host = 'http://assets.example.com'
28
+
29
+ # Specifies the header that your server uses for sending files.
30
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
31
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
32
+
33
+ # Force all access to the app over SSL, use Strict-Transport-Security,
34
+ # and use secure cookies.
35
+ # config.force_ssl = true
36
+
37
+ config.action_mailer.perform_caching = false
38
+
39
+ # Ignore bad email addresses and do not raise email delivery errors.
40
+ # Set this to true and configure the email server for immediate delivery to
41
+ # raise delivery errors.
42
+ # config.action_mailer.raise_delivery_errors = false
43
+
44
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
45
+ # the I18n.default_locale when a translation cannot be found).
46
+ config.i18n.fallbacks = true
47
+
48
+ # Send deprecation notices to registered listeners.
49
+ config.active_support.deprecation = :notify
50
+
51
+ # Use default logging formatter so that PID and timestamp are not suppressed.
52
+ config.log_formatter = ::Logger::Formatter.new
53
+
54
+ # Do not dump schema after migrations.
55
+ config.active_record.dump_schema_after_migration = false
56
+ end
@@ -0,0 +1,6 @@
1
+ require_relative 'production.rb'
2
+
3
+ Rails.application.configure do
4
+ # Overwrite any production settings here, or if you want to start from
5
+ # scratch then remove line 1.
6
+ end
@@ -0,0 +1,40 @@
1
+ Rails.application.configure do
2
+ # The test environment is used exclusively to run your application's
3
+ # test suite. You never need to work with it otherwise. Remember that
4
+ # your test database is "scratch space" for the test suite and is wiped
5
+ # and recreated between test runs. Don't rely on the data there!
6
+ config.cache_classes = true
7
+
8
+ # Do not eager load code on boot. This avoids loading your whole application
9
+ # just for the purpose of running a single test. If you are using a tool that
10
+ # preloads Rails for running tests, you may have to set it to true.
11
+ config.eager_load = false
12
+
13
+ # Configure public file server for tests with Cache-Control for performance.
14
+ config.public_file_server.enabled = true
15
+ config.public_file_server.headers = {
16
+ 'Cache-Control' => 'public, max-age=3600'
17
+ }
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+ config.action_mailer.perform_caching = false
29
+
30
+ # Tell Action Mailer not to deliver emails to the real world.
31
+ # The :test delivery method accumulates sent emails in the
32
+ # ActionMailer::Base.deliveries array.
33
+ config.action_mailer.delivery_method = :test
34
+
35
+ # Print deprecation notices to the stderr.
36
+ config.active_support.deprecation = :stderr
37
+
38
+ # Raises error for missing translations
39
+ # config.action_view.raise_on_missing_translations = true
40
+ end
@@ -0,0 +1,6 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ApplicationController.renderer.defaults.merge!(
4
+ # http_host: 'example.org',
5
+ # https: false
6
+ # )
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Pre-compile additional assets.
10
+ Rails.application.config.assets.precompile << proc do |path|
11
+ true if path =~ /\.(eot|svg|ttf|woff|png)\z/
12
+ end
@@ -0,0 +1,9 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't
4
+ # wish to see in your backtraces.
5
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
6
+
7
+ # You can also remove all the silencers if you're trying to debug a problem
8
+ # that might stem from framework code.
9
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,27 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains migration options to ease your Rails 5.0 upgrade.
4
+ #
5
+ # Read the Rails 5.0 release notes for more info on each option.
6
+
7
+ # Enable per-form CSRF tokens. Previous versions had false.
8
+ Rails.application.config.action_controller.per_form_csrf_tokens = true
9
+
10
+ # Enable origin-checking CSRF mitigation. Previous versions had false.
11
+ Rails.application.config
12
+ .action_controller.forgery_protection_origin_check = true
13
+
14
+ # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
15
+ # Previous versions had false.
16
+ ActiveSupport.to_time_preserves_timezone = true
17
+
18
+ # Require `belongs_to` associations by default. Previous versions had false.
19
+ Rails.application.config.active_record.belongs_to_required_by_default = true
20
+
21
+ # Do not halt callback chains when a callback returns false.
22
+ # Previous versions had true.
23
+ ActiveSupport.halt_callback_chains_on_return_false = false
24
+
25
+ # Configure SSL options to enable HSTS with subdomains.
26
+ # Previous versions had false.
27
+ Rails.application.config.ssl_options = { hsts: { subdomains: true } }
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store,
4
+ key: '_orats_base_session'
@@ -1,7 +1,4 @@
1
- sidekiq_config = {
2
- url: ENV['BACKGROUND_URL'],
3
- namespace: "ns_app::sidekiq_#{Rails.env}"
4
- }
1
+ sidekiq_config = { url: ENV['ACTIVE_JOB_URL'] }
5
2
 
6
3
  Sidekiq.configure_server do |config|
7
4
  config.redis = sidekiq_config
@@ -0,0 +1 @@
1
+ Rack::Timeout.timeout = ENV.fetch('REQUEST_TIMEOUT') { 5 }.to_i
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format
7
+ # to an empty array.
8
+ ActiveSupport.on_load(:action_controller) do
9
+ wrap_parameters format: [:json]
10
+ end
11
+
12
+ # To enable root element in JSON for ActiveRecord objects.
13
+ # ActiveSupport.on_load(:active_record) do
14
+ # self.include_root_in_json = true
15
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: 'Hello world'
@@ -0,0 +1,60 @@
1
+ # Bind on a specific TCP address. We won't bother using unix sockets because
2
+ # nginx will be running in a different Docker container.
3
+ bind "tcp://#{ENV['BIND_ON']}"
4
+
5
+ # Puma supports threading. Requests are served through an internal thread pool.
6
+ # Even on MRI, it is beneficial to leverage multiple threads because I/O
7
+ # operations do not lock the GIL. This typically requires more CPU resources.
8
+ #
9
+ # More threads will increase CPU load but will also increase throughput.
10
+ #
11
+ # Like anything this will heavily depend on the size of your instance and web
12
+ # application's demands. 5 is a relatively safe number, start here and increase
13
+ # it based on your app's demands.
14
+ #
15
+ # RAILS_MAX_THREADS will match the default thread size for Active Record.
16
+ threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }.to_i
17
+ threads threads_count, threads_count
18
+
19
+ # Puma supports spawning multiple workers. It will fork out a process at the
20
+ # OS level to support concurrent requests. This typically requires more RAM.
21
+ #
22
+ # If you're looking to maximize performance you'll want to use as many workers
23
+ # as you can without starving your server of RAM.
24
+ #
25
+ # This value isn't really possible to auto-calculate if empty, so it defaults
26
+ # to 2 when it's not set. That is heavily leaning on the safe side.
27
+ #
28
+ # Ultimately you'll want to tweak this number for your instance size and web
29
+ # application's needs.
30
+ #
31
+ # If using threads and workers together, the concurrency of your application
32
+ # will be THREADS * WORKERS.
33
+ workers ENV.fetch('WEB_CONCURRENCY') { 2 }
34
+
35
+ # An internal health check to verify that workers have checked in to the master
36
+ # process within a specific time frame. If this time is exceeded, the worker
37
+ # will automatically be rebooted. Defaults to 60s.
38
+ #
39
+ # Under most situations you will not have to tweak this value, which is why it
40
+ # is coded into the config rather than being an environment variable.
41
+ worker_timeout 30
42
+
43
+ # The path to the puma binary without any arguments.
44
+ restart_command 'puma'
45
+
46
+ # Use the `preload_app!` method when specifying a `workers` number.
47
+ # This directive tells Puma to first boot the application and load code before
48
+ # forking the application. This takes advantage of Copy On Write process
49
+ # behavior so workers use less memory. If you use this option you need to make
50
+ # sure to reconnect any threads in the `on_worker_boot` block.
51
+ # preload_app!
52
+
53
+ # on_worker_boot do
54
+ # Since you'll likely use > 1 worker in production, we'll need to configure
55
+ # Puma to do a few things when a worker boots.
56
+
57
+ # We need to connect to the database. Pooling is handled automatically since
58
+ # we'll set the connection pool value in the DATABASE_URL later.
59
+ # defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
60
+ # end
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ root 'pages#home'
3
+ end
@@ -1,6 +1,7 @@
1
1
  ---
2
+
2
3
  development: &default
3
- secret_key_base: <%= ENV['TOKEN_RAILS_SECRET'] %>
4
+ secret_key_base: <%= ENV['SECRET_TOKEN'] %>
4
5
 
5
6
  test:
6
7
  <<: *default
@@ -9,4 +10,4 @@ staging:
9
10
  <<: *default
10
11
 
11
12
  production:
12
- <<: *default
13
+ <<: *default
@@ -0,0 +1,5 @@
1
+ ---
2
+
3
+ :queues:
4
+ - <%= ENV['ACTIVE_JOB_QUEUE_PREFIX'] %>_<%= ENV['RAILS_ENV'] %>_default
5
+ - <%= ENV['ACTIVE_JOB_QUEUE_PREFIX'] %>_<%= ENV['RAILS_ENV'] %>_mailers
@@ -0,0 +1,6 @@
1
+ %w(
2
+ .ruby-version
3
+ .rbenv-vars
4
+ tmp/restart.txt
5
+ tmp/caching-dev.txt
6
+ ).each { |path| Spring.watch(path) }
@@ -0,0 +1,9 @@
1
+ # This file should contain all the record creation needed to seed the database
2
+ # with its default values.
3
+ # The data can then be loaded with the rails db:seed command
4
+ # or created alongside the database with db:setup.
5
+ #
6
+ # Examples:
7
+ #
8
+ # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
9
+ # Character.create(name: 'Luke', movie: movies.first)
@@ -0,0 +1,59 @@
1
+ version: '2'
2
+
3
+ services:
4
+ postgres:
5
+ image: 'postgres:9.5'
6
+ environment:
7
+ POSTGRES_USER: 'orats_base'
8
+ POSTGRES_PASSWORD: 'yourpassword'
9
+ ports:
10
+ - '5432:5432'
11
+ volumes:
12
+ - 'postgres:/var/lib/postgresql/data'
13
+
14
+ redis:
15
+ image: 'redis:3.2-alpine'
16
+ command: redis-server --requirepass yourpassword
17
+ ports:
18
+ - '6379:6379'
19
+ volumes:
20
+ - 'redis:/var/lib/redis/data'
21
+
22
+ website:
23
+ depends_on:
24
+ - 'postgres'
25
+ - 'redis'
26
+ build: .
27
+ ports:
28
+ - '3000:3000'
29
+ volumes:
30
+ - '.:/orats_base'
31
+ env_file:
32
+ - '.env'
33
+
34
+ sidekiq:
35
+ depends_on:
36
+ - 'postgres'
37
+ - 'redis'
38
+ build: .
39
+ command: sidekiq -C config/sidekiq.yml.erb
40
+ volumes:
41
+ - '.:/orats_base'
42
+ env_file:
43
+ - '.env'
44
+
45
+ cable:
46
+ depends_on:
47
+ - 'redis'
48
+ build: .
49
+ command: puma -p 28080 cable/config.ru
50
+ ports:
51
+ - '28080:28080'
52
+ volumes:
53
+ - '.:/orats_base'
54
+ env_file:
55
+ - '.env'
56
+
57
+ volumes:
58
+ redis:
59
+ postgres:
File without changes
File without changes
File without changes