The in-place pg_upgrade in the db entrypoint could crash-loop or fail on real clusters. This reworks it: - Idempotent, crash-safe: replace the fragile migration_in_progress marker with a state-driven guard on the old_data/new_data scratch dirs. An empty leftover means a run was interrupted before any data moved (data still intact at $PGDATA) so it is discarded and retried; a non-empty one means data may live only there, so it stops for manual recovery. Removes both the "mkdir: File exists" crash-loop and the silent fresh-initdb-over-live-data window. - Correct install user: pg_upgrade must run as the old cluster's bootstrap superuser (oid 10), and the new cluster must be initialised with that same user. It is not necessarily $POSTGRES_USER (clusters created with the default "postgres" superuser plus a separate app role are common). Detect it from the old cluster (briefly start it and read pg_roles where oid = 10) and use it for both the new cluster's initdb and the pg_upgrade -U argument. - Bump DB_ENTRYPOINT_VERSION to v3 so swarm reloads the (immutable) config. Verified on cctest: clean 13->17, interrupted-then-retried, and prod-like clusters whose install user is "postgres" with a separate "discourse" app role.
Discourse
A platform for community discussion
- Category: Apps
- Status:
- Image:
bitnami/discourse - Healthcheck: yes
- Backups: no
- Email: yes
- Tests: no
- SSO: no
Basic usage
- Set up Docker Swarm and
abra - Deploy
coop-cloud/traefik abra app new discourse --secrets(optionally with--passif you'd like to save secrets inpass)abra app config YOURAPPDOMAIN- be sure to change$DOMAINto something that resolves to your Docker swarm boxabra app deploy YOURAPPDOMAIN- Open the configured domain in your browser to finish set-up
To add a new admin user
- Login to the instance
abra app run APPNAME app sh cd /opt/bitnami/discourseRAILS_ENV=production bundle exec rake admin:createand follow prompts.
Install plugins
- Login to instance
abra app run APPNAME app sh cd /bitnami/discourse/plugins/git clone plugin.gitfor examplehttps://github.com/discourse/discourse-openid-connect.gitabra app restart YOURAPPDOMAIN app
Events / calendar plugin
We've had some luck running discourse-events.
Setup Notes
Until issue #1 is fixed, the default user is user and the default password is bitnami123
Postgres major version upgrades
Welcome to hell.
abra app run YOURAPPDOMAIN db pg_dumpall -U discourse | gzip > YOURAPPDOMAIN_db_DATE.sql.gzabra app volume ls YOURAPPDOMAIN, find the name of the Postgres data volumescpthe backup to your VPSabra app undeploy YOURAPPDOMAINabra app volume rm YOURAPPDOMAIN, choose the Postgres data volumeabra app deploy YOURAPPDOMAIN, thenabra app undeploy YOURAPPDOMAINsshto the VPS, run (replacing13-alpinewith the new Postgres version)docker run -v YOURDATAVOLUME:/var/lib/postgresql/data -e POSTGRES_HOST_AUTH_METHOD=trust -it postgres:13-alpine- In another SSH session on the server, run
docker psto find the ID of the new Postgres container, thendocker exec -it CONTAINERID bash - In the shell you just launched, run
dropdb -U discourse discourse, thencreatedb -U discourse discourse, then Ctrl+D or runexit - In the second SSH session, run
zcat YOURAPPDOMAIN_db_DATE.sql.gz | docker exec -it CONTAINERID psql -U discourse - Exit the second SSH session
- Back in the first SSH session, Ctrl+C to shut down the database
abra app deploy YOURAPPDOMAIN
Languages
Shell
100%