Deploying

Deploying Jumpstart Pro is easy. We've even configured a staging environment for you.

You'll need a Redis and PostgreSQL database setup to deploy Jumpstart Pro.

Environments

Jumpstart Pro is preconfigured with two environments for deploying: staging and production.

Background workers will be configured to run in all environments so you will have the same experience in development as you will in staging and production.

Email providers will only be configured for production by Jumpstart Pro, so you don't accidentally send emails to real users in staging.

Credentials

You will need to take the contents of config/credentials/staging.key or config/credentials/production.key (depending on what env you're deploying) and set the RAILS_MASTER_KEY environment variable to the contents of this file. This will allow staging or production to decrypt your credentials for the correct environment.

Deploy to Hatchbox

Hatchbox.io is built by the makers of Jumpstart Pro and GoRails. It's a fantastically simple and cheap option for deploying apps to your own servers.

Deploy to Render.com

Jumpstart Pro comes with a render.yaml file that helps Render pre-configure your application. Be sure to update the repo value in the services section of this file to point to the github repository for your Jumpstart Pro application as noted in the comments inside the file.

# Example Render configuration. You will need to adjust this for the different services you run.
# Replace repo url with the repository url for your Jumpstart Pro application
services:
  - type: web
    repo: https://github.com/GITHUB_USERNAME/GITHUB_REPOSITORY # Replace this url
    name: rails
    env: ruby
    region: oregon # the region must be consistent across all services for the internal keys to be read
    buildCommand: "./bin/render-build.sh"
    startCommand: bundle exec rails s
    envVars:
      - key: RAILS_MASTER_KEY
        sync: false
      - key: DATABASE_URL
        fromDatabase:
          name: postgres
          property: connectionString
      - key: REDIS_URL
        fromService:
          type: redis
          name: redis
          property: connectionString

  - type: redis
    name: redis
    region: oregon # the region must be consistent across all services for the internal keys to be read
    ipAllowList: [] # only allow internal connections
    plan: free # optional (defaults to starter)
    maxmemoryPolicy: noeviction # optional (defaults to allkeys-lru)

  # Uncomment the following blueprint if you want to enable a background worker
  # - type: worker
  #   name: sidekiq-worker
  #   env: ruby
  #   plan: starter # no free option for bg workers
  #   region: oregon # the region must be consistent across all services for the internal keys to be read
  #   buildCommand: "./bin/render-build.sh"
  #   startCommand: bundle exec sidekiq -e production
  #   envVars:
  #     - key: DATABASE_URL
  #       fromDatabase:
  #         name: postgres
  #         property: connectionString
  #     - key: REDIS_URL
  #       fromService:
  #         name: redis
  #         type: redis
  #         property: connectionString
  #     - key: RAILS_MASTER_KEY
  #       sync: false

databases:
  - name: postgres
    region: oregon # the region must be consistent across all services for the internal keys to be read
    ipAllowList: [] # only allow internal connections

Simply copy this URL and paste it into your browser, then change the GitHub URL to point to your private repository.

https://render.com/deploy?repo=https://github.com/jumpstart-pro/jumpstart-pro-rails

Deploy to Heroku

Deploying to Heroku is easy. Jumpstart Pro includes a Procfile to help automatically configure your Heroku processes.

Deploy using Heroku Deploy Button

Jumpstart Pro comes with an app.json file that helps Heroku pre-configure your application if you use GitHub to host your Jumpstart Pro repo.

Heroku will use your connected GitHub account to access the private repo and find the app.json to pre-configure your new app. You can read more about the Heroku Deploy Button for private repos here.

Simply copy this URL and paste it into your browser, then change the GitHub URL to point to your private repository.

https://dashboard.heroku.com/new?template=https://github.com/excid3/jumpstart-pro

Deploy using Heroku CLI

First, you'll need to install the Heroku CLI and login with heroku login

Now you can create a Heroku app by running heroku create myapp

We also need to tell Heroku which buildpacks to use:

heroku buildpacks:set heroku/ruby
heroku buildpacks:add --index 1 heroku/nodejs

You'll need to setup PostgreSQL and Redis addons to run your app.

heroku addons:create heroku-postgresql:hobby-dev
heroku addons:create heroku-redis:hobby-dev

Afterwards, you need to add the RAILS_MASTER_KEY environment variable and set it equal to the key inside config/credentials/production.key.

Then you can deploy your code to Heroku and run migrations.

git push heroku master
heroku run rails db:migrate

Docker

We provide a sample Dockerfile and docker-compose.yml for you in case you'd like to deploy your application using Docker.

Creating An Admin User

To create an admin user in production, you can either generate one using db/seeds.rb or run the following code in the rails console in production.

user = User.create! name: "Steve Jobs", email: "steve@apple.com", password: "password", password_confirmation: "password", terms_of_service: true
Jumpstart.grant_system_admin! user