-
Notifications
You must be signed in to change notification settings - Fork 189
/
application.rb
38 lines (30 loc) · 1.4 KB
/
application.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
require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Hello
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
# Log to STDOUT because Docker expects all processes to log here. You could
# then collect logs using journald, syslog or forward them somewhere else.
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
# Set Redis as the back-end for the cache.
config.cache_store = :redis_cache_store, {
url: ENV.fetch("REDIS_URL") { "redis://redis:6379/1" },
namespace: "cache"
}
# Set Sidekiq as the back-end for Active Job.
config.active_job.queue_adapter = :sidekiq
# Mount Action Cable outside the main process or domain.
config.action_cable.mount_path = nil
config.action_cable.url = ENV.fetch("ACTION_CABLE_FRONTEND_URL") { "ws://localhost:28080" }
# Only allow connections to Action Cable from these domains.
origins = ENV.fetch("ACTION_CABLE_ALLOWED_REQUEST_ORIGINS") { "http:\/\/localhost*" }.split(",")
origins.map! { |url| /#{url}/ }
config.action_cable.allowed_request_origins = origins
end
end