Conversation
… var Replace hard-coded wait-for-it timeouts with a configurable WAIT_POSTGRES_TIMEOUT environment variable (default: 180s) across all docker-compose files. This allows users on slower hardware (e.g. NAS devices) to adjust the timeout without modifying the compose files. Closes #212
📝 WalkthroughWalkthroughThe changes parameterize the PostgreSQL readiness timeout across Docker Compose configurations (dev and prod) by replacing hardcoded values with an environment variable Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docker-compose.dev.yml`:
- Line 55: The wait-for-it invocations use unquoted variable expansion for the
timeout; update every bash -c call that passes ${WAIT_POSTGRES_TIMEOUT:-180}
(e.g., the wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180}
occurrences) to quote the expansion ("${WAIT_POSTGRES_TIMEOUT:-180}") so
word-splitting and special characters are preserved; apply this change to all
matching wait-for-it calls across the compose files mentioned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0cb0137f-ee5c-471d-ab4c-53dab37b7548
📒 Files selected for processing (3)
docker-compose.dev.ymldocker-compose.prod.ymlexample.env
| command: > | ||
| bash -c " | ||
| wait-for-it -s postgres.local:5432 -t 60 && | ||
| wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify unquoted WAIT_POSTGRES_TIMEOUT usage in compose files.
rg -nP 'wait-for-it\s+-s\s+postgres\.local:5432\s+-t\s+\$\{WAIT_POSTGRES_TIMEOUT:-180\}' --iglob 'docker-compose*.yml'Repository: openradx/radis
Length of output: 690
🏁 Script executed:
cat -n docker-compose.dev.yml | sed -n '50,85p'Repository: openradx/radis
Length of output: 1461
🏁 Script executed:
cat -n docker-compose.prod.yml | sed -n '25,80p'Repository: openradx/radis
Length of output: 1880
Quote WAIT_POSTGRES_TIMEOUT in all docker-compose shell commands.
Unquoted variable expansion in bash -c can cause word-splitting and argument parsing failures if the environment variable contains spaces or special characters. Quote the timeout argument at each callsite.
Affected locations
- docker-compose.dev.yml: lines 55, 72, 81
- docker-compose.prod.yml: lines 29, 64, 74
Suggested patch
- wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} &&
+ wait-for-it -s postgres.local:5432 -t "${WAIT_POSTGRES_TIMEOUT:-180}" &&Apply to all 6 occurrences.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| wait-for-it -s postgres.local:5432 -t ${WAIT_POSTGRES_TIMEOUT:-180} && | |
| wait-for-it -s postgres.local:5432 -t "${WAIT_POSTGRES_TIMEOUT:-180}" && |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docker-compose.dev.yml` at line 55, The wait-for-it invocations use unquoted
variable expansion for the timeout; update every bash -c call that passes
${WAIT_POSTGRES_TIMEOUT:-180} (e.g., the wait-for-it -s postgres.local:5432 -t
${WAIT_POSTGRES_TIMEOUT:-180} occurrences) to quote the expansion
("${WAIT_POSTGRES_TIMEOUT:-180}") so word-splitting and special characters are
preserved; apply this change to all matching wait-for-it calls across the
compose files mentioned.
There was a problem hiding this comment.
Code Review
This pull request introduces a configurable timeout for waiting for the PostgreSQL database to become available during container startup. Hardcoded timeout values in both development and production Docker Compose files have been replaced with a new environment variable, WAIT_POSTGRES_TIMEOUT, which defaults to 180 seconds. The example.env file was also updated to include this variable along with documentation for its use on low-power hardware. I have no feedback to provide.
Remove PostgreSQL wait timeout configuration.
Summary
wait-for-ittimeouts with a configurableWAIT_POSTGRES_TIMEOUTenvironment variable across all docker-compose files.envwithout modifying compose filesCloses #212
Test plan
docker compose configcorrectly interpolates the default (180s) whenWAIT_POSTGRES_TIMEOUTis unsetWAIT_POSTGRES_TIMEOUT=300in.envoverrides allwait-for-itcalls🤖 Generated with Claude Code
Summary by CodeRabbit
WAIT_POSTGRES_TIMEOUTenvironment variable (defaults to 180 seconds).