Application Configuration

The commands in the Application Configuration section should be run by the non-root user.

Git

Download your Rails application to your home directory:

git clone <URL>

In the future, simply download the new commits from the remote repository:

git pull

Rails

If your CSS is compiled using Webpacker, make sure to use the stylesheet_pack_tag.

Prepare the application for running in production using the following commands:

RAILS_ENV=production bundle install
RAILS_ENV=production rails assets:precompile
RAILS_ENV=production rails db:create
RAILS_ENV=production rails db:migrate
RAILS_ENV=production rails db:seed

Nginx

Using the template below, create a new Nginx configuration file:

Restart Nginx:

Systemd

Using the template below, create a new Systemd initialisation file:

Enable the service:

You can restart and check the status of the service using the following commands:

Last updated