Skip to content

How to put the mk peerage app into production

Monique Rio edited this page Mar 9, 2018 · 1 revision

For a server that can run rails this is what you'd need to do to get the website up and running: The following need to be installed globally:

  • git
  • imagemagick

These also need to be installed globally, and I have more detailed instructions on how to do that below:

  • ruby version 2.5.0 (although if another version is already on there, let me know and I can adapt the app)
  • bundle (whatever version makes sense for the ruby version)
  • node version 9.5.0 (again, let me know if another version is on there and I can adapt.)
  • yarn version 1.3.2
  • webpack version 3.11.0

Detailed instructions for ruby install

$ rbenv install --verbose 2.5.0

in the app's root directory run:

$ ruby -v 

Response should be 2.5.0 (maybe some other trailing things)

$ gem install bundle

Detailed instructions for node and its relations

Install nvm: https://github.com/creationix/nvm#install-script

$ nvm install 9.5.0
$ npm install -g [email protected]
$ yarn global add [email protected]

Rest of install

Once all of that's installed.

$ git clone https://github.com/niquerio/mk-peerage.git
  • Set some environment variables, which I can give you when we're actually ready to go.
  • Configure the database. (I support postgres, mysql, and sqlite. Others should be able to work if you want to configure them.) In /config are a few database.DBTYPE.yml files, one of which should be copied to config/database.yml. The database user needs to be created and configured beforehand.
$ npm run webpack:deploy
$ bundle install
$ bundle exec rails db:create RAILS_ENV=production
$ bundle exec rails db:migrate RAILS_ENV=production
$ bundle exec rails server -e production

That will serve the site at localhost:3000. The database will be setup but empty at this point.

The webserver will need to be configured to run the app. Typical setups would be with apache or nginx proxying requests to localhost:3000 (or the app running on some other port) or with mod_passengerin apache.