Skip to content

Instantly share code, notes, and snippets.

@heyellieday
Last active January 22, 2016 01:11
Show Gist options
  • Save heyellieday/6cd93ada309f5aa669dd to your computer and use it in GitHub Desktop.
Save heyellieday/6cd93ada309f5aa669dd to your computer and use it in GitHub Desktop.
Files for Viable Rails App
#Add to config/applicaton.rb
config.autoload_paths += Dir["#{config.root}/lib/**/"]
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="//oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<style>
.ng-hide {
display: none !important;
}
</style>
<![endif]-->
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
adapter: postgresql
encoding: unicode
database: app_name
pool: 5
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.postgres
#set delivery method to letter_opener gem
config.action_mailer.delivery_method = :letter_opener
web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq -q default -q mailers
#force ssl
if ENV['force_ssl'] == 'true'
config.force_ssl = true
else
config.force_ssl = false
end
#configure action_mailer
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = {:host => ENV['default_mailer_url']}
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:authentication => :plain,
:address => "smtp.mailgun.org",
:port => 587,
:domain => ENV["mailgun_domain"],
:user_name => ENV["mailgun_username"],
:password => ENV["mailgun_password"]
}
threads_count = Integer(ENV['MAX_THREADS'] || 1)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
if ENV["REDISCLOUD_URL"]
$redis = Redis.new(:url => ENV["REDISCLOUD_URL"])
else
$redis = Redis.new(:url => 'redis://127.0.0.1:6379/0')
end
if ENV["REDISCLOUD_URL"]
Sidekiq.configure_server do |config|
config.redis = {url: ENV["REDISCLOUD_URL"]}
end
Sidekiq.configure_client do |config|
config.redis = {url: ENV["REDISCLOUD_URL"]}
end
else
Sidekiq.configure_server do |config|
config.redis = {url: 'redis://127.0.0.1:6379/0'}
end
Sidekiq.configure_client do |config|
config.redis = {url: 'redis://127.0.0.1:6379/0'}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment