Created
July 18, 2018 14:57
-
-
Save pftg/70927b1ab4c14e0925d024a806b027bb to your computer and use it in GitHub Desktop.
Heroku Review Setup for Ruby on Rails 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "rails-web-application-on-heroku", | |
"env": { | |
"RAILS_ENV": "staging", | |
"RACK_ENV": "staging", | |
"NODE_ENV": "production", | |
"BUNDLE_WITHOUT": "production:development:test", | |
"DB_SEED_ON_REDEPLOY": { | |
"description": "Reset database on redeploy", | |
"value": "true" | |
}, | |
"RAILS_MAX_THREADS": "5", | |
"WEB_CONCURRENCY": "2", | |
"HEROKU_APP_NAME": { | |
"required": true | |
}, | |
"RAILS_LOG_TO_STDOUT": { | |
"required": true | |
}, | |
"RAILS_SERVE_STATIC_FILES": { | |
"required": true | |
} | |
}, | |
"addons": [ | |
"heroku-postgresql:hobby-dev", | |
"memcachier:dev" | |
], | |
"buildpacks": [ | |
{ | |
"url": "heroku/ruby" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "== Preparing database ==" | |
bin/rails db:migrate | |
# Reset database for testing purpose on staging | |
if [ "$DB_SEED_ON_REDEPLOY" = "true" ]; then | |
echo "Seeding ..." | |
bin/rails db:seed | |
echo "Seeding has been done!" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
release: bin/heroku-release | |
web: bundle exec puma -C config/puma.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment