fix(app): use stack-prefixed hostnames for redis and db #8
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-redis-host"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
appservice was missingDISCOURSE_REDIS_HOSTentirely, so the bitnami image defaulted to the bare hostnameredis. 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.sidekiqhad the same problem for both DB and Redis:DISCOURSE_DATABASE_HOST=dbandDISCOURSE_REDIS_HOST=redisused bare hostnames instead of the stack-prefixed service names.Changes:
app: addDISCOURSE_REDIS_HOST=${STACK_NAME}_redissidekiq: fixDISCOURSE_DATABASE_HOST=db→${STACK_NAME}_dbsidekiq: fixDISCOURSE_REDIS_HOST=redis→${STACK_NAME}_redisNo 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', 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.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.