Forked from https://github.com/intercity/chef-repo. Special thanks to them!
These collection of chef recipes:
- install MySQL for databases
- set up the
craigslistpoetry-api
project with the proper directory structure forcapitstrano
deploys. - Set's up cron jobs to email admin users an activity email, send out tweets, and perform daily backups.
- Includes configuration management for all sensitive API keys and passwords for various external services.
The following paragraphs will guide you to set up your own server to host Ruby on Rails applications.
Clone the repository onto your own workstation. For example in your ~/Code
directory:
$ cd ~/Code
$ git clone git://github.com/msquitieri/craigslistpoetry-api-chef.git
Run bundle:
$ bundle install
Run Librarian install:
$ librarian-chef install
Edit the nodes/api.json
file and set up all of the configuration of database passwords, etc. When that is done, just run:
knife solo bootstrap USER@HOST_IP nodes/api.json
This will install chef on your server and run it for the first time.
If you want to just do a chef run on the server, run:
knife solo cook USER@HOST_IP nodes/api.json
Change the host IP in the config/deploy/production.rb, and run bundle exec cap production deploy
That's it! The application should have been deployed.
Chef will automatically include the certbot. All you need to do is run the command:
sudo certbot --nginx
and follow the prompts. A cron will automatically trigger the renewal every 60 days.
Please see related repos to this project:
- craigslistpoetry-frontend repo, which is written in Ember
- craigslistpoetry-api repo, a Ruby on Rails application to retreive poems and their data.