neil 66d7ef2fb0 Discourse spike: official-image compose for Coolify restore test
official discourse/discourse:2026.9.0-latest (all-in-one web+sidekiq) +
pgvector/pgvector:pg16 + redis:7. External DB/redis (DISCOURSE_DB_SOCKET='' forces
TCP), MIGRATE_ON_BOOT=1, /shared volume for uploads+backups. Restore-fidelity test
of the bedford-ma backup (schema v20250709051949).
2026-08-31 15:36:00 -04:00

discourse-spike

Throwaway official-image Discourse stack to spike-test restoring the bedford-ma backup (bedford-ma-community-forums-2026-08-30-…-v20250709051949.tar.gz, ~Discourse 3.5.x) on Coolify → worker2. GREEN = migrate bedfordma to Coolify (compose); RED = official launcher install on a father VM.

Stack

  • webdiscourse/discourse:2026.9.0-latest (launcher-built web_only image: nginx + unicorn/pitchfork + supervised sidekiq in one container)
  • dbpgvector/pgvector:pg16 (Discourse schema requires the vector extension)
  • redisredis:7

Deploy (via @shrug/coolify on shrug-coolify-root → worker2)

  1. createComposeApplication from this private repo (build_pack=dockercompose)
  2. upsertApplicationEnvs — set the vars from .env.example (real values)
  3. setComposeDomains{"web": "https://<temp-domain>:80"} (temp sslip.io/nip.io)
  4. deploy (instantDeploy) → poll getDeployment to finished
  5. First-boot: MIGRATE_ON_BOOT=1 runs db:migrate on the empty DB → clean Discourse

Restore the backup

Backup file must sit in the container at /shared/backups/default/.

# on worker2 (via a worker2 cfgmgmt/exec model): copy backup into the web container's /shared
docker cp <backup>.tar.gz $(docker ps -qf name=web):/shared/backups/default/
docker exec <web> discourse enable_restore
docker exec <web> discourse restore <backup>.tar.gz
docker exec <web> discourse disable_restore
# hostname differs from bedfordma.today -> remap + rebake:
docker exec <web> discourse remap bedfordma.today <temp-domain>
docker exec <web> discourse rake posts:rebake

Verify (GREEN criteria)

  • Web loads at the temp domain; can log in
  • Posts / users / categories / uploads all present (uploads render, not broken links)
  • discourse doctor clean-ish

Known risks to watch on first deploy

  • :443 binding — the image has SSL templates baked (DISABLE_LETSENCRYPT=1). We only expose :80 and terminate TLS at Coolify's proxy; confirm the container doesn't crash trying :443.
  • Backup dir — restore only sees /shared/backups/default/ (exact path).
  • DB superuser — restore drops/recreates schema + CREATE EXTENSION; discourse role is POSTGRES_USER (superuser) so that's covered.
S
Description
No description provided
Readme 27 KiB