Advertisement
Guest User

Production.rb

a guest
Apr 14th, 2015
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 3.44 KB | None | 0 0
  1. Rails.application.configure do
  2.   # Settings specified here will take precedence over those in config/application.rb.
  3.  
  4.   # Setting up Cloudfront CDN for both http and https
  5.   config.action_controller.asset_host = ->(source, request=nil, *_){
  6.     if request && request.ssl?
  7.       ENV['CLOUDFRONT_ENDPOINT_SECURE']
  8.     else
  9.       ENV['CLOUDFRONT_ENDPOINT']
  10.     end
  11.   }
  12.  
  13.  
  14.   # Setting up production host link
  15.   config.action_mailer.default_url_options = { host: 'boiling-beyond-8903.herokuapp.com/'}
  16.  
  17.   # Mailer outgoing server setup
  18.   config.action_mailer.delivery_method = :smtp
  19.   config.action_mailer.perform_deliveries = true
  20.   config.action_mailer.raise_delivery_errors = false
  21.   config.action_mailer.default :charset => 'utf-8'
  22.  
  23.   config.action_mailer.delivery_method = :smtp
  24.   config.action_mailer.smtp_settings = {
  25.     :user_name => ENV["SENDGRID_USERNAME"],
  26.     :password => ENV["SENDGRID_PASSWORD"],
  27.     :address => 'smtp.sendgrid.net',
  28.     :domain => ENV["SENDGRID_DOMAIN"],
  29.     :port => '587',
  30.     :authentication => :plain,
  31.     :enable_starttls_auto => true
  32.   }
  33.  
  34.   # Code is not reloaded between requests.
  35.   config.cache_classes = true
  36.  
  37.   # Eager load code on boot. This eager loads most of Rails and
  38.   # your application in memory, allowing both threaded web servers
  39.   # and those relying on copy on write to perform better.
  40.   # Rake tasks automatically ignore this option for performance.
  41.   config.eager_load = true
  42.  
  43.   # Full error reports are disabled and caching is turned on.
  44.   config.consider_all_requests_local       = false
  45.   config.action_controller.perform_caching = true
  46.  
  47.   # Enable Rack::Cache to put a simple HTTP cache in front of your application
  48.   # Add `rack-cache` to your Gemfile before enabling this.
  49.   # For large-scale production use, consider using a caching reverse proxy like
  50.   # NGINX, varnish or squid.
  51.   # config.action_dispatch.rack_cache = true
  52.  
  53.   #Depend on configuration from initializers
  54.   config.assets.initialize_on_precompile = true
  55.  
  56.   # Disable serving static files from the `/public` folder by default since
  57.   # Apache or NGINX already handles this.
  58.   config.serve_static_files = true
  59.  
  60.   # Compress JavaScripts and CSS.
  61.   config.assets.js_compressor = :uglifier
  62.   # config.assets.css_compressor = :sass
  63.  
  64.   # Do not fallback to assets pipeline if a precompiled asset is missed.
  65.   config.assets.compile = true
  66.  
  67.   config.assets.enabled = true
  68.   # Asset digests allow you to set far-future HTTP expiration dates on all assets,
  69.   # yet still be able to expire them through the digest params.
  70.   config.assets.digest = true
  71.  
  72.   #prefix S3 asset files so that they are stored in folder
  73.   config.assets.prefix = "/production/assets"
  74.  
  75.   # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
  76.  
  77.   # Specifies the header that your server uses for sending files.
  78.   config.action_dispatch.x_sendfile_header = nil
  79.  
  80.   config.log_level = :debug
  81.  
  82.   # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  83.   # the I18n.default_locale when a translation cannot be found).
  84.   config.i18n.fallbacks = true
  85.  
  86.   # Send deprecation notices to registered listeners.
  87.   config.active_support.deprecation = :notify
  88.  
  89.   # Use default logging formatter so that PID and timestamp are not suppressed.
  90.   config.log_formatter = ::Logger::Formatter.new
  91.  
  92.   # Do not dump schema after migrations.
  93.   config.active_record.dump_schema_after_migration = false
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement