Configure a server for a Rails application.
rails_app
- sets uprails_directories
andrails_logrotate
rails_database
- creates the application databaserails_environment
- sets up system-wide environment variablesrails_js
- installs Node.js and yarnrails_nginx
- sets up Nginx for the app:- redirect http to https
- obtain https certificates
- proxy to the Rails application
rails_ruby
- installs a required Ruby and Bundler versionsrails_systemd
- manages the Rails app as a systemd service
rails_directories
- creates a directory for the app, containing shared and shared/configrails_logrotate
- sets up log rotation for application-specific logsrails_nginx_http
- if you don't want to run your app over https, this resource simply proxies port 80 to your Rails application port (default 3000)rails_secrets
- createsconfig/secrets.yml
- not needed if you userails_environment
rails_shared_file
- creates a file under theshared
directory
In order to install Ruby versions, add the following dependencies:
cookbook "chef-nginx"
cookbook "ruby_build"
cookbook "ruby_rbenv"
and put this in metadata.rb
:
depends "ruby_build"
depends "ruby_rbenv"
- Chef 13.0 or later