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.
SSH to the server then run
sudo apt-get install git-core
git clone <repo_https> chmod 755 rails chown -R rails:www-data <repo>
- Configure the database to point to the database
- Install gems
bundle install --deployment
- Add any environmental variables to
- 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;