Discourse is a re-imagined online forum software. Installing Discourse can be quite an involved process. We use Docker, an exciting new container management tool, to greatly ease its install process.
Get yourself a Ubuntu 13.04 VM (I recommend DigitalOcean), and start getting Discourse up and running in a few minutes:
# Install docker
open http://docs.docker.io/en/latest/installation/ubuntulinux/#ubuntu-raring
# Install postgresql-client for management-tasks
sudo apt-get install postgresql-client
# Install supervisor, the process manager
sudo apt-get install python-pip
sudo pip install supervisor
git clone https://github.com/srid/discourse-docker.git
cd discourse-docker
# Pull the docker images (expect this to download a few megabytes)
make pull # or `make build` if you want to locally build them
# Configure your discourse site domain (DISCOURSE_HOST)
more etc/env
echo 'export DISCOURSE_HOST=mysite.com:5000' > .env
# OPTIONAL: email support via postmarkapp.com.
# later, add the 'From' address to Discourse admin settings.
echo 'export POSTMARK_API_KEY=<apikey>' >> .env
# Start supervisor on a separate terminal window. This will
# automatically start the redis and postgresql containers.
make supervisor
# Verify that redis-server and postgres are running.
# Note: bin/sup is alias to `sudo supervisorctl`.
bin/sup status
# Setup the discourse database and compile static assets.
# Note: postgres data is at data/postgres; discourse public/
# (containing uploaded files) directory is mounted from
# data/discourse-public.
bin/discourse-start setup
# Finally, start discourse, sidekiq and nginx
bin/sup start discourse sidekiq nginx
# Discourse is now running; launch the discourse site URL.
make info
# After signing up for an account, make yourself an admin:
bin/make-admin myusername
-
Set
DISCOURSE_VERSION
in discourse/Dockerfile to the appropriate version -
Rebuild the images using
make build
-
Stop supervisord, clean up running docker containers, and run
make supervisord
-
Run
bin/discourse-start setup
(this will run rake db:migrate) -
Run
bin/discourse-start "bundle exec rake assets:precompile"
-
Start discourse and the rest:
bin/sup start all
To migrate from an existing Discourse forum:
-
Start only postgresql,redis
-
Take a snapshot of the database and import it right after starting the postgresql container.
-
Run
bin/discourse-start setup
. If the assets creation step fails, try re-running it usingbin/discourse-start "bundle exec rake assets:precompile"
. -
Import public/uploads directory into data/discourse-public/uploads
-
Start everything: bin/sup start all