Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae5a81802b |
@@ -6,60 +6,67 @@ A platform for community discussion
|
|||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
* **Category**: Apps
|
* **Category**: Apps
|
||||||
* **Status**: 3, experimental
|
* **Status**:
|
||||||
* **Image**: [`discourse/discourse`](https://hub.docker.com/r/discourse/discourse), 4, upstream
|
* **Image**: [`bitnami/discourse`](https://hub.docker.com/r/bitnami/discourse)
|
||||||
* **Healthcheck**: yes
|
* **Healthcheck**: yes
|
||||||
* **Backups**: yes
|
* **Backups**: no
|
||||||
* **Email**: yes
|
* **Email**: yes
|
||||||
* **Tests**: yes
|
* **Tests**: no
|
||||||
* **SSO**: no
|
* **SSO**: no
|
||||||
<!-- endmetadata -->
|
<!-- endmetadata -->
|
||||||
|
|
||||||
> **Note**: this recipe runs the official, **experimental** `discourse/discourse`
|
|
||||||
> image. Upstream does not yet recommend it for production — see
|
|
||||||
> <https://meta.discourse.org/t/380646>. Use with care.
|
|
||||||
|
|
||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
||||||
1. Set up Docker Swarm and [`abra`]
|
1. Set up Docker Swarm and [`abra`]
|
||||||
2. Deploy [`coop-cloud/traefik`]
|
2. Deploy [`coop-cloud/traefik`]
|
||||||
3. `abra app new discourse --secrets` (optionally with `--pass` to save secrets in `pass`)
|
3. `abra app new discourse --secrets` (optionally with `--pass` if you'd like
|
||||||
4. `abra app config YOURAPPDOMAIN` — set `DOMAIN` and `DISCOURSE_DEVELOPER_EMAILS`
|
to save secrets in `pass`)
|
||||||
|
4. `abra app config YOURAPPDOMAIN` - be sure to change `$DOMAIN` to something that resolves to
|
||||||
|
your Docker swarm box
|
||||||
5. `abra app deploy YOURAPPDOMAIN`
|
5. `abra app deploy YOURAPPDOMAIN`
|
||||||
6. Open the configured domain in your browser to finish set-up. The first account
|
6. Open the configured domain in your browser to finish set-up
|
||||||
that registers with an address listed in `DISCOURSE_DEVELOPER_EMAILS` becomes
|
|
||||||
an admin.
|
|
||||||
|
|
||||||
[`abra`]: https://docs.coopcloud.tech/abra/
|
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
|
||||||
[`coop-cloud/traefik`]: https://git.coopcloud.tech/coop-cloud/traefik
|
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
|
||||||
|
|
||||||
The app serves plain HTTP on port 80; Traefik terminates TLS in front of it. The
|
## To add a new admin user
|
||||||
image's built-in nginx/Let's Encrypt is disabled by the recipe (`install-ssl`
|
|
||||||
override) so it works behind the reverse proxy.
|
|
||||||
|
|
||||||
## Add an admin user
|
1. Login to the instance `abra app run APPNAME app sh`
|
||||||
|
2. `cd /opt/bitnami/discourse`
|
||||||
|
3. `RAILS_ENV=production bundle exec rake admin:create` and follow prompts.
|
||||||
|
|
||||||
```
|
## Install plugins
|
||||||
abra app run YOURAPPDOMAIN app discourse admin create
|
|
||||||
```
|
1. Login to instance `abra app run APPNAME app sh`
|
||||||
|
2. `cd /bitnami/discourse/plugins/`
|
||||||
|
3. `git clone plugin.git` for example `https://github.com/discourse/discourse-openid-connect.git`
|
||||||
|
4. `abra app restart YOURAPPDOMAIN app`
|
||||||
|
|
||||||
|
### Events / calendar plugin
|
||||||
|
|
||||||
|
We've had some luck running [discourse-events](https://github.com/paviliondev/discourse-events).
|
||||||
|
|
||||||
|
## Setup Notes
|
||||||
|
|
||||||
|
Until issue #1 is fixed, the default user is `user` and the default password is `bitnami123`
|
||||||
|
|
||||||
## Postgres major version upgrades
|
## Postgres major version upgrades
|
||||||
|
|
||||||
Handled automatically. The `db` entrypoint detects an older data directory on
|
Welcome to hell.
|
||||||
deploy and runs `pg_upgrade` in place (it installs the old binaries, detects the
|
|
||||||
cluster's real install superuser, and upgrades). No manual dump/restore needed.
|
|
||||||
|
|
||||||
## Migrating from the previous (bitnami) recipe
|
1. `abra app run YOURAPPDOMAIN db pg_dumpall -U discourse | gzip > YOURAPPDOMAIN_db_DATE.sql.gz`
|
||||||
|
2. `abra app volume ls YOURAPPDOMAIN`, find the name of the Postgres data volume
|
||||||
The official image stores uploads under `/shared` rather than bitnami's
|
3. `scp` the backup to your VPS
|
||||||
`/bitnami/discourse`. On first boot the recipe copies uploads + backups from the
|
4. `abra app undeploy YOURAPPDOMAIN`
|
||||||
old bitnami volume (mounted read-only at `/legacy`) into `/shared`, once,
|
5. `abra app volume rm YOURAPPDOMAIN`, choose the Postgres data volume
|
||||||
idempotently. The Postgres database is reused as-is. After a successful migration
|
6. `abra app deploy YOURAPPDOMAIN`, then `abra app undeploy YOURAPPDOMAIN`
|
||||||
a later recipe version will drop the transitional `/legacy` mount.
|
7. `ssh` to the VPS, run (replacing `13-alpine` with the new Postgres version)
|
||||||
|
`docker run -v YOURDATAVOLUME:/var/lib/postgresql/data -e POSTGRES_HOST_AUTH_METHOD=trust -it postgres:13-alpine`
|
||||||
If you are upgrading from the bitnami recipe, also remove the now-unused sidekiq
|
8. In another SSH session on the server, run `docker ps` to find the ID of the
|
||||||
service that swarm leaves behind (sidekiq runs inside the app container now):
|
new Postgres container, then `docker exec -it CONTAINERID bash`
|
||||||
|
9. In the shell you just launched, run `dropdb -U discourse discourse`, then
|
||||||
```
|
`createdb -U discourse discourse`, then Ctrl+D or run `exit`
|
||||||
docker service rm YOURSTACK_sidekiq
|
10. In the second SSH session, run `zcat YOURAPPDOMAIN_db_DATE.sql.gz | docker exec -it CONTAINERID psql -U discourse`
|
||||||
```
|
11. Exit the second SSH session
|
||||||
|
12. Back in the first SSH session, Ctrl+C to shut down the database
|
||||||
|
13. `abra app deploy YOURAPPDOMAIN`
|
||||||
|
|||||||
-15
@@ -83,15 +83,6 @@ services:
|
|||||||
- POSTGRES_USER=discourse
|
- POSTGRES_USER=discourse
|
||||||
- POSTGRES_DB=discourse
|
- POSTGRES_DB=discourse
|
||||||
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
|
||||||
healthcheck:
|
|
||||||
test: "pg_isready -U discourse -d discourse"
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 5
|
|
||||||
# generous: a postgres major-version upgrade (apt install + pg_upgrade) runs
|
|
||||||
# in the entrypoint before the server accepts connections — don't let the
|
|
||||||
# healthcheck kill an in-progress migration
|
|
||||||
start_period: 10m
|
|
||||||
deploy:
|
deploy:
|
||||||
labels:
|
labels:
|
||||||
backupbot.backup: "true"
|
backupbot.backup: "true"
|
||||||
@@ -105,12 +96,6 @@ services:
|
|||||||
- internal
|
- internal
|
||||||
volumes:
|
volumes:
|
||||||
- 'redis_data:/data'
|
- 'redis_data:/data'
|
||||||
healthcheck:
|
|
||||||
test: "redis-cli ping | grep -q PONG"
|
|
||||||
interval: 30s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 5
|
|
||||||
start_period: 30s
|
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
db_password:
|
db_password:
|
||||||
|
|||||||
Reference in New Issue
Block a user