feat(db): switch to discourse/postgres image (auto-upgrade) — squashed for upstream #16 #7

Open
autonomic-bot wants to merge 2 commits from discourse-official into main

Single notplants commit (1f77af9) on top of the official-image commit (0c4539b), matching the intended shape of coop-cloud/discourse#16. Switches the db to discourse/postgres:pg18 with auto-upgrade. Running !testme below.

Single notplants commit (1f77af9) on top of the official-image commit (0c4539b), matching the intended shape of coop-cloud/discourse#16. Switches the db to discourse/postgres:pg18 with auto-upgrade. Running !testme below.
autonomic-bot added 2 commits 2026-06-22 20:05:06 +00:00
Replaces the paywalled bitnamilegacy app with the official discourse/discourse
image behind Traefik. DB is reused as-is; uploads migrate from the legacy
bitnami volume idempotently. The wrapper entrypoint injects the db_password and
smtp_password secrets (the official image has no *_FILE support). SMTP env vars
are renamed to the official names; release notes cover the migration.

Recipe 0.8.1+3.5.0 -> 1.0.0+3.5.3 (major: new image, env/volume/port changes).
feat(db): switch to discourse/postgres image (auto-upgrade)
Some checks failed
cc-ci/testme cc-ci: failure
1f77af93bd
Move the db off the bitnami-era pgvector:pg17 + hand-rolled pg_upgrade entrypoint
to discourse/postgres:pg18 (pgvector + discourse's auto-upgrade layer). The image
runs the in-place major-version pg_upgrade itself on boot; the recipe configures it
via env:

- a small inline entrypoint injects the db password secret into $DB_PASSWORD (the
  image expects it in the env, no *_FILE support)
- POSTGRES_USER (the install user pg_upgrade must match) defaults to 'postgres' --
  correct for fresh installs and bitnami-origin clusters -- overridable from .env
- POSTGRES_INITDB_ARGS=--no-data-checksums so the new pg18 cluster matches pre-18
  clusters (pg18 initdb enables checksums by default; pg_upgrade needs a match)

- mount postgresql_data at /var/lib/postgresql (versioned PGDATA .../18/docker)
- pg_backup.sh uses POSTGRES_USER for the dump/drop/recreate; fix paths
- document the POSTGRES_USER override in .env.sample, README and the release note
- drop entrypoint.postgres.sh.tmpl

Tested on cctest: pg17->pg18 upgrade preserves data and serves over HTTPS; fresh
install works; backup+restore round-trips.
Author
Owner

!testme

!testme
Author
Owner

🌻 cc-cidiscourse @ 1f77af93 killedhttps://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/944

(summary card unavailable — see the run for details.) full logs · dashboard

<!-- cc-ci:testme --> 🌻 **cc-ci** — `discourse` @ `1f77af93` ❌ **killed** → https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/944 _(summary card unavailable — see the run for details.)_ [full logs](https://drone.ci.commoninternet.net/recipe-maintainers/cc-ci/944) · [dashboard](https://ci.commoninternet.net/)
Some checks failed
cc-ci/testme cc-ci: failure
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin discourse-official:discourse-official
git checkout discourse-official
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: recipe-maintainers/discourse#7
No description provided.