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

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

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
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 fix-redis-host:fix-redis-host
git checkout fix-redis-host
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#8
No description provided.