Skip to content

compose: fix Redis password env var reference in backend service#3542

Closed
Nsanjayboruds wants to merge 1 commit intoOWASP:mainfrom
Nsanjayboruds:fix/compose-redis-password-env
Closed

compose: fix Redis password env var reference in backend service#3542
Nsanjayboruds wants to merge 1 commit intoOWASP:mainfrom
Nsanjayboruds:fix/compose-redis-password-env

Conversation

@Nsanjayboruds
Copy link

Resolves #3541

Summary
The local Docker Compose configuration for the backend service incorrectly references the Redis host variable for the password, causing Redis authentication failures. This PR updates the environment variable to use the correct password reference.

File: compose.yml
Change

DJANGO_REDIS_PASSWORD: ${DJANGO_REDIS_HOST:-nest-cache-password}
+ DJANGO_REDIS_PASSWORD: ${DJANGO_REDIS_PASSWORD:-nest-cache-password}

Rationale
Prevents Redis authentication failures in local development
Ensures consistent environment variable usage across services
Aligns with the cache service (--requirepass $REDIS_PASSWORD) and the worker service, which already use the correct variable

Validation Steps
1.Set a custom password in Nest/backend/.env:

DJANGO_REDIS_PASSWORD=my-secure-password

2.Start the local stack:

make run

3.Confirm the backend starts without Redis auth errors and cache operations work.
4.Run project checks and tests:

make check-test

Scope & Risk
Limited to local development compose
One-line change; minimal risk
No impact on production/staging compose files

@github-actions
Copy link

The linked issue must be assigned to the PR author.

@github-actions github-actions bot closed this Jan 25, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Caution

Review failed

The pull request is closed.

Summary by CodeRabbit

  • Chores
    • Updated Redis password configuration resolution in the deployment setup to ensure proper credential handling when environment variables are not explicitly provided.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Updated the DJANGO_REDIS_PASSWORD environment variable in the local Docker Compose configuration to reference DJANGO_REDIS_PASSWORD instead of DJANGO_REDIS_HOST. This ensures correct Redis password resolution when the variable is not explicitly set.

Changes

Cohort / File(s) Summary
Docker Compose Environment Configuration
docker-compose/local/compose.yaml
Corrected DJANGO_REDIS_PASSWORD variable reference from using DJANGO_REDIS_HOST fallback to using DJANGO_REDIS_PASSWORD fallback, fixing Redis authentication resolution

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • arkid15r
  • kasya
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Redis password env var in local Docker Compose

1 participant