Skip to content

fix(dev): allow configurable Postgres and Redis host ports#2486

Open
saadaltafofficial wants to merge 1 commit into
block:mainfrom
saadaltafofficial:fix/configurable-dev-ports
Open

fix(dev): allow configurable Postgres and Redis host ports#2486
saadaltafofficial wants to merge 1 commit into
block:mainfrom
saadaltafofficial:fix/configurable-dev-ports

Conversation

@saadaltafofficial

Copy link
Copy Markdown

This pull request introduces flexible host port configuration for Postgres and Redis, making it easier to run the development environment alongside local database services (like those installed via Homebrew) without port conflicts. The .env.example, docker-compose.yml, and scripts/dev-setup.sh have been updated to support remapping host ports and to validate that environment variables and connection URLs remain consistent. The setup script now also checks for local Postgres/Redis processes that would block Docker from binding the desired ports and provides clear error messages and remediation steps.

The most important changes are:

Flexible host port configuration:

  • Added PGPORT and BUZZ_REDIS_HOST_PORT environment variables to .env.example to allow remapping the host ports for Postgres and Redis, with clear documentation and examples. (.env.example) [1] [2] [3]
  • Updated docker-compose.yml to use ${PGPORT:-5432} and ${BUZZ_REDIS_HOST_PORT:-6379} for publishing container ports, making host port selection dynamic. (docker-compose.yml) [1] [2]

Environment validation and improved setup safety:

  • Enhanced scripts/dev-setup.sh to extract ports from URLs, validate that environment variables and URLs match, and fail early if misconfigured (e.g., PGPORT does not match DATABASE_URL). [1] [2]
  • Added checks in scripts/dev-setup.sh to detect and block setup if local Postgres or Redis instances are already listening on the desired ports, with actionable error messages and instructions for resolving conflicts.
  • Improved developer experience by printing a summary of any host port remapping in the setup output.

Defaults stay 5432/6379; remap via PGPORT / BUZZ_REDIS_HOST_PORT when
local services already own the standard ports. Setup validates URL/port
pairs and checks collisions on the configured ports.
Closes block#2479

Signed-off-by: saadaltafofficial <saadbeenco@gmail.com>
@saadaltafofficial
saadaltafofficial requested a review from a team as a code owner July 23, 2026 08:27
@saadaltafofficial
saadaltafofficial force-pushed the fix/configurable-dev-ports branch from 5f39b89 to 4ddf4b9 Compare July 23, 2026 08:45
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.

1 participant