Manages discourse apps on your dokku server.
# For dokku >= v0.22.0
dokku plugin:install https://github.com/badsyntax/dokku-discourse.git
# For dokku < v0.22.0
dokku plugin:install https://github.com/badsyntax/dokku-discourse.git --committish 0.2.1
dokku plugin:update discourse
discourse:help # Shows help
discourse:create <app> # Creates/rebuilds a discourse app
discourse:destroy <app> # Destroys a discourse app
discourse:upgrade <app> # Upgrades a discourse app
discourse:install-plugin <app> <git_url> # Installs a plugin for a discourse app
discourse:list # Lists discourse apps
Each discourse app is a separate standalone discourse instance.
dokku discourse:create discourse-app
A new docker image will be built and this process can take some time.
You'll be prompted for various discourse configuration values.
Data will be stored in location /var/lib/dokku/data/storage/APP_NAME
.
Once your app is built & deployed, you can treat it as any other dokku app. You should use the dokku-letsencrypt plugin for adding TLS.
Continue with the offical discourse install instructions to complete the discourse installation, ignoring any TLS setup instructions.
A discourse container config file is created when a discourse app is created. The config is based on standalone.yml.
You can edit the config at /home/dokku/APP_NAME/discourse_standalone.yml
. Don't make any changes to the volumes
section, but feel free to change anything else.
After making change be sure to run dokku discourse:create <app>
to rebuild and re-deploy the discourse app.
The easiest way to upgrade is to use the admin.
You can also upgrade a discourse app with the following:
dokku discourse:upgrade discourse-app
The running discourse app will be stopped, the docker image rebuilt and the app redeployed.
Install the akismet plugin:
dokku discourse:install-plugin discourse-app https://github.com/discourse/discourse-akismet
The running discourse app will be stopped, the docker image rebuilt and the app redeployed.
dokku discourse:destroy discourse-app
Destroying an app does not remove the data directory at /var/lib/dokku/data/storage/APP_NAME
.
dokku plugin:uninstall discourse
Running discourse apps and images are unaffected.
To completely remove everything related to discourse:
- Destroy all discourse apps:
dokku discourse:destroy $(dokku discourse:list -q)
- Uninstall the discourse plugin:
dokku plugin:uninstall discourse
- Remove the base discourse image:
docker rmi $(docker images -q discourse/base)
- Remove discourse data directories at
/var/lib/dokku/data/storage/
.
You'll need a backup archive created by discourse, and a fresh discourse app.
Follow the instructions above to create a new discourse app. Ensure you've registered an admin account as you'll need to login to the admin to restore the backup. If the backup site was using TLS, you need to set this up on the new instance before continuing (via dokku letsencrypt
).
Discourse allows you restore a backup in the admin, but you need to copy the backup into the discourse container first. This is achieved by copying the backup into the host directory that's mounted to the container.
First, ensure the default backup directory exists on the host:
Substitute APP_NAME with the name of the discourse app you just created.
ssh [email protected]
mkdir /var/lib/dokku/data/storage/APP_NAME/backups/default/
Exit your server and use scp (or similar) to copy the archive file to the server.
Substitute APP_NAME with the name of the discourse app you just created.
scp discourse-backup.tar.gz [email protected]:/var/lib/dokku/data/storage/APP_NAME/backups/default/
Login to the admin and restore from backup.
To complete the restoration, you'll need install plugins that were previously installed. Use the dokku discourse:install-plugin
command to do so.
- https://medium.com/batary/deploying-discourse-with-dokku-5eec28e2ad8b
- https://gist.github.com/julienma/a101a72fdd97932bf28909633f45c7be
See DEVELOPMENT.md.
See LICENSE.md.