This is a Discourse application that is configured and ready to run locally, or be deployed to production, using 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 code
git clone https://github.com/nanobox-quickstarts/nanobox-discourse.git
# cd into the discourse app
cd nanobox-discourse
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
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...
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 your applicaiton to the local staging environment:
nanobox deploy dry-run
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>
Before you deploy you'll need to add (at least) the following evars:
- DISCOURSE_HOSTNAME=www.your-site.com
- RAILS_ENV=production
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).
Then, simply deploy:
nanobox deploy
Once your deploy is complete you should be able to view your application online.