fix(app): use stack-prefixed hostnames for redis and db #8

Closed
autonomic-bot wants to merge 1 commits from fix-redis-host into main
Owner

The app service was missing DISCOURSE_REDIS_HOST entirely, so the bitnami image defaulted to the bare hostname redis. When a service is attached to multiple overlay networks (proxy + internal), bare service-name DNS does not resolve reliably — the stack-prefixed name (${STACK_NAME}_redis) is required. This caused the app to WARN "Hostname redis could not be resolved" and fall into a restart loop.

sidekiq had the same problem for both DB and Redis: DISCOURSE_DATABASE_HOST=db and DISCOURSE_REDIS_HOST=redis used bare hostnames instead of the stack-prefixed service names.

Changes:

  • app: add DISCOURSE_REDIS_HOST=${STACK_NAME}_redis
  • sidekiq: fix DISCOURSE_DATABASE_HOST=db${STACK_NAME}_db
  • sidekiq: fix DISCOURSE_REDIS_HOST=redis${STACK_NAME}_redis

No image or version bump — this is a compose env-var fix only.

cc @trav @notplants

The `app` service was missing `DISCOURSE_REDIS_HOST` entirely, so the bitnami image defaulted to the bare hostname `redis`. When a service is attached to multiple overlay networks (proxy + internal), bare service-name DNS does not resolve reliably — the stack-prefixed name (`${STACK_NAME}_redis`) is required. This caused the app to WARN "Hostname redis could not be resolved" and fall into a restart loop. `sidekiq` had the same problem for both DB and Redis: `DISCOURSE_DATABASE_HOST=db` and `DISCOURSE_REDIS_HOST=redis` used bare hostnames instead of the stack-prefixed service names. **Changes:** - `app`: add `DISCOURSE_REDIS_HOST=${STACK_NAME}_redis` - `sidekiq`: fix `DISCOURSE_DATABASE_HOST=db` → `${STACK_NAME}_db` - `sidekiq`: fix `DISCOURSE_REDIS_HOST=redis` → `${STACK_NAME}_redis` No image or version bump — this is a compose env-var fix only. cc @trav @notplants
autonomic-bot added 1 commit 2026-06-23 16:48:22 +00:00
The app service was missing DISCOURSE_REDIS_HOST entirely, so the
bitnami image defaulted to the bare hostname 'redis', which does not
resolve when the service is attached to multiple overlay networks
(proxy + internal) — causing a restart loop.

sidekiq had the same problem worse: both DISCOURSE_DATABASE_HOST=db
and DISCOURSE_REDIS_HOST=redis used bare hostnames instead of the
stack-prefixed service names. On a swarm stack the reliable DNS name
is ${STACK_NAME}_db / ${STACK_NAME}_redis.
autonomic-bot requested review from trav 2026-06-23 16:48:22 +00:00
autonomic-bot requested review from notplants 2026-06-23 16:48:23 +00:00
Author
Owner

Closing as obsolete: the stack-prefixed hostname fix it proposes is ALREADY in upstream main (DISCOURSE_DB_HOST=${STACK_NAME}_db, DISCOURSE_REDIS_HOST=${STACK_NAME}_redis). This branch is written against the bitnami image (bitnamilegacy/discourse:3.5.0, version 0.8.1+3.5.0, old ruby healthcheck), so merging it would REVERT the official-image migration. upstream main is now discourse/discourse:3.5.3 + discourse/postgres:pg18 (version 1.0.0+3.5.3, commit 9d5c8ae) — the official-image migration landed upstream as coop-cloud/discourse#16. If any hostname issue remains on the official image, please re-raise it against current main.

The live upgrade PR for discourse is #6 (discourse/discourse:3.5.3 → 2026.7.1, redis:7.4-alpine → 8.10-alpine), which applies cleanly on top of current upstream and stays open.

Closing as **obsolete**: the stack-prefixed hostname fix it proposes is ALREADY in upstream main (`DISCOURSE_DB_HOST=${STACK_NAME}_db`, `DISCOURSE_REDIS_HOST=${STACK_NAME}_redis`). This branch is written against the bitnami image (`bitnamilegacy/discourse:3.5.0`, version `0.8.1+3.5.0`, old ruby healthcheck), so merging it would REVERT the official-image migration. upstream main is now `discourse/discourse:3.5.3` + `discourse/postgres:pg18` (version `1.0.0+3.5.3`, commit 9d5c8ae) — the official-image migration landed upstream as coop-cloud/discourse#16. If any hostname issue remains on the official image, please re-raise it against current main. The live upgrade PR for discourse is #6 (`discourse/discourse:3.5.3 → 2026.7.1`, `redis:7.4-alpine → 8.10-alpine`), which applies cleanly on top of current upstream and stays open.
autonomic-bot closed this pull request 2026-08-10 20:25:03 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: recipe-maintainers/discourse#8