Skip to content

Instantly share code, notes, and snippets.

@brunoschagas
Forked from pcreux/Gemfile
Created May 22, 2014 13:44
Show Gist options
  • Save brunoschagas/b181e9ef9a2812e21d6c to your computer and use it in GitHub Desktop.
Save brunoschagas/b181e9ef9a2812e21d6c to your computer and use it in GitHub Desktop.

Free addons!

heroku addons:add memcachier
heroku addons:add mandrill:starter
heroku addons:add newrelic
heroku addons:add pgbackups
heroku addons:add papertrail
group :production do
gem 'passenger'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
gem 'memcachier'
gem 'dalli'
# Fast IO for memcache
gem 'kgio'
# Serve static assets through Rack + Memcache
# https://devcenter.heroku.com/articles/rack-cache-memcached-rails31
gem 'rack-cache'
web: bundle exec passenger start -p $PORT --max-pool-size 3
# config/environments/production.rb
# ...
# Enable Rails's static asset server for Heroku
config.serve_static_assets = true
# Set static assets cache header. rack-cache will cache those.
config.static_cache_control = "public, max-age=31536000"
config.cache_store = :dalli_store
client = Dalli::Client.new(ENV["MEMCACHIER_SERVERS"],
:value_max_bytes => 10485760,
:expires_in => 86400) # 1 day
# Configure rack-cache for using memcachier
config.action_dispatch.rack_cache = {
:metastore => client,
:entitystore => client
}
# Send emails via mandrill
ActionMailer::Base.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'smtp.mandrillapp.com',
:port => '587',
:authentication => :plain,
:user_name => ENV['MANDRILL_USERNAME'],
:password => ENV['MANDRILL_APIKEY'],
:domain => 'heroku.com',
}
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment