HackBrexit / MinistersUnderTheInfluence

MIT License
6 stars 10 forks source link

Set up ministersundertheinfluence.co.uk DigitalOcean server #133

Open aspiers opened 7 years ago

aspiers commented 7 years ago

Description

We now have http://ministersundertheinfluence.co.uk up and running, with a Rails droplet deployed; however we haven't deployed any of our code on it yet.

Comments, Questions and Considerations

Looks like we'll use Capistrano for Rails deployment. Remaining questions:

Acceptance Criteria

This story can be considered done when the following is satisfied:

Given the DigitalOcean server is configured, When I visit http://ministersundertheinfluence.co.uk Then I get the React frontend UI, showing live data from the Rails backend

elischutze commented 7 years ago
aspiers commented 7 years ago

@elischutze Thanks I agree with all of this. By web UI do you only mean the React UI or also the Rails web UI?

elischutze commented 7 years ago

just React

Greatlemer commented 7 years ago

That all sounds fine to me.

aspiers commented 7 years ago

@Greatlemer I'm still not sure about the Apache / unicorn / puma / Passenger / whatever decision. I've just emailed @JohnSmall who probably knows more about this, so hopefully he'll respond soon.

JohnSmall commented 7 years ago

I found the OneClick Rails app provided by Digital Ocean to be very tied into a specific way of doing things specifically 1) It assumes you're going to be deploying via SFTP or a single main branch from a Git repo 2) RVM was setup for the system, not for the rails user. Which causes some irritations when installing gems 3) The configuration for nginx and unicorn is spread over many configuration files and bash scripts and quite tricky to modify it to work with a different directory that's using Capistrano deployment.

After a full weekend messing around with the configuration a few weeks ago. I threw my hands in the air and set up a trial system using Nginx and Phusion Passenger on a bare bones DO droplet, in less than an hour.

I created a script and by running it on many bare DO droplets I've refined it into a gist to be run against a DO droplet which configures everything just right to accept a Capistrano deployment from the /src/ruby/meetings directory.

The gist is here digital-ocean-rails.sh

And I've also got a snapshot of the droplet I created I can send to you and you can replace the droplet with the new configuration. It has a functioning Rails app running on it and can be updated via

`cap production deploy`

I'll be checking in the branch I used for to get Capistrano working with this, and create a PR for it.