Correções para funcionamento do Docker
This commit is contained in:
22
config/environments/development.rb
Normal file
22
config/environments/development.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
Rails.application.configure do
|
||||
config.enable_reloading = true
|
||||
config.eager_load = false
|
||||
config.consider_all_requests_local = true
|
||||
config.server_timing = true
|
||||
|
||||
config.cache_store = :memory_store
|
||||
config.active_storage.service = :local if defined?(ActiveStorage)
|
||||
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
config.action_mailer.perform_caching = false
|
||||
config.action_mailer.default_url_options = { host: ENV.fetch("APP_HOST", "localhost:3000") }
|
||||
|
||||
config.active_support.deprecation = :log
|
||||
config.active_record.migration_error = :page_load
|
||||
config.active_record.verbose_query_logs = true
|
||||
|
||||
config.assets.quiet = true if config.respond_to?(:assets)
|
||||
config.hosts.clear # aceita qualquer host em dev (Docker/IP local)
|
||||
end
|
||||
27
config/environments/production.rb
Normal file
27
config/environments/production.rb
Normal file
@@ -0,0 +1,27 @@
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
Rails.application.configure do
|
||||
config.enable_reloading = false
|
||||
config.eager_load = true
|
||||
config.consider_all_requests_local = false
|
||||
|
||||
config.force_ssl = false # mude para true quando tiver HTTPS
|
||||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
||||
config.log_tags = [:request_id]
|
||||
config.logger = ActiveSupport::Logger.new(STDOUT).tap { |l| l.formatter = ::Logger::Formatter.new }
|
||||
.then { |l| ActiveSupport::TaggedLogging.new(l) }
|
||||
|
||||
config.cache_store = :memory_store
|
||||
config.active_storage.service = :local if defined?(ActiveStorage)
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
config.action_mailer.default_url_options = { host: ENV.fetch("APP_HOST", "localhost:3000") }
|
||||
|
||||
config.i18n.fallbacks = true
|
||||
config.active_support.report_deprecations = false
|
||||
config.active_record.dump_schema_after_migration = false
|
||||
|
||||
# Aceita o host configurado no .env
|
||||
config.hosts << ENV["APP_HOST"]&.split(":")&.first if ENV["APP_HOST"].present?
|
||||
config.hosts.clear if ENV["RAILS_ALLOW_ALL_HOSTS"] == "true"
|
||||
end
|
||||
10
config/environments/test.rb
Normal file
10
config/environments/test.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
require "active_support/core_ext/integer/time"
|
||||
|
||||
Rails.application.configure do
|
||||
config.enable_reloading = false
|
||||
config.eager_load = ENV["CI"].present?
|
||||
config.consider_all_requests_local = true
|
||||
config.cache_store = :null_store
|
||||
config.action_mailer.delivery_method = :test
|
||||
config.active_support.deprecation = :stderr
|
||||
end
|
||||
Reference in New Issue
Block a user