Recently I moved the site from Heroku to DigitalOcean. As you can imagine, deployment could be difficult. Therefore I'd like to summarise the steps to deploy to DigitalOcean.
Create a droplet with one-click Ruby on Rails Application
First of all, you need to create a droplet in DigitalOcean.
Install git
SSH to the server then run
sudo apt-get install git-core
Configurate codebase
git clone <repo_https>
chmod 755 rails
chown -R rails:www-data <repo>
Deploy
- Configure the database to point to the database
- Install gems
bundle install --deployment
- Add any environmental variables to
/etc/default/unicorn
- Restart the server
service unicorn restart
Allow remote access to the DB
sudo nano /etc/mysql/my.cnf bind-address = your_database_IP GRANT ALL PRIVILEGES ON db.* To 'user'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;