nanobox-quickstarts / nanobox-discourse

A platform for community discussion. Free, open, simple.

Home Page:http://guides.nanobox.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discourse from scratch

Discourse from scratch

This is a Discourse application that is configured and ready to run locally, or be deployed to production, using Nanobox.

Download Nanobox

To get started you'll first need to download Nanobox. You can do this from the Nanobox dashboard after creating a free Nanobox account.

Clone the repo

# clone the code
git clone https://github.com/nanobox-quickstarts/nanobox-discourse.git

# cd into the discourse app
cd nanobox-discourse

Run Discourse Locally

First, add a convenient way to access your app from the browser and then drop into a Nanobox development console:

# add a local DNS alias
nanobox dns add local discourse.dev

# drop into a nanobox development console
nanobox run

From inside the Nanobox console you'll run data migrations, create a new admin user, and start your app:

# run migrations
rake db:migrate

# create an admin user
rake admin:create

# start your application
rails s

Visit your app at discourse.dev

Stage Discourse Locally (optionl)

Nanobox allows you to stage your application locally before deploying to production. This dry-run environment simulates your app's production environment. If it works here, it will work in production...

Add Necessary Environment Variables

To simulate the application running in a production environment, rails needs to be told to run in production mode:

nanobox evar add dry-run RAILS_ENV=production

"Deploy"

Deploy your applicaiton to the local staging environment:

nanobox deploy dry-run

Deploy Discourse to Production

To deploy Discourse to production with Nanobox you'll need to launch a new application.

Once your new app is up-and-running you can link this codebase to your running application:

nanobox remote add <your-new-apps-name>

Add Necessary Environment Variables

Before you deploy you'll need to add (at least) the following evars:

If you want to send mail you'll need to add these evars:

  • DISCOURSE_SMTP_ADDRESS
  • DISCOURSE_SMTP_PORT
  • DISCOURSE_SMTP_DOMAIN
  • DISCOURSE_SMTP_USER_NAME
  • DISCOURSE_SMTP_PASSWORD

Evars can either be added via Nanobox Desktop or Nanobox Dashboard (See our docs).

Deploy

Then, simply deploy:

nanobox deploy

Once your deploy is complete you should be able to view your application online.

About

A platform for community discussion. Free, open, simple.

http://guides.nanobox.io

License:GNU General Public License v2.0


Languages

Language:Ruby 60.8%Language:JavaScript 30.6%Language:HTML 5.5%Language:CSS 3.1%Language:Shell 0.1%Language:Nginx 0.0%