Skip to content

Make every published host port overridable - #19

Merged
sahilkalgutkar merged 1 commit into
mainfrom
fix/overridable-host-ports
Sep 1, 2026
Merged

sahilkalgutkar merged 1 commit into
mainfrom
fix/overridable-host-ports

Conversation

@sahilkalgutkar

@sahilkalgutkar sahilkalgutkar commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

The gap

The quickstart already had an escape hatch for Postgres — point
MODELFORGE_DATABASE_URL at your own instance and skip make db — but nothing
for the observability stack. Grafana was pinned to 3000, which is taken on
any machine running a Node dev server, and Prometheus to 9090. make up then
fails on a port bind with no documented way out.

The change

POSTGRES_HOST_PORT, PROMETHEUS_HOST_PORT and GRAFANA_HOST_PORT, each
defaulting to what it was. The Makefile exports them so docker compose picks
them up, and DB/TEST_DB are built from POSTGRES_HOST_PORT rather than a
literal 5432 — an override that moved the container but left the connection
strings pointing at the old port would be a knob that breaks things rather than
fixing them. make up echoes the ports actually in use, and the README gains
the override table.

Only the host side moves; inside the compose network the services still reach
each other on the standard ports.

Verification

  • docker compose config resolves the defaults (5432/9090/3000) and the
    overrides (5433/9091/3001).
  • make -n run POSTGRES_HOST_PORT=5433 shows the connection string following.
  • The README's own make db && make test ran green end to end under
    POSTGRES_HOST_PORT=5433, total coverage 90.0%.

The quickstart already had an escape hatch for Postgres -- point
MODELFORGE_DATABASE_URL at your own instance and skip `make db` -- but nothing
for the observability stack. Grafana was pinned to 3000, which is taken on any
machine running a Node dev server, and Prometheus to 9090. `make up` then fails
on a port bind with no documented way out.

Add POSTGRES_HOST_PORT, PROMETHEUS_HOST_PORT and GRAFANA_HOST_PORT, defaulting
to what they were. The Makefile exports them so `docker compose` picks them up,
and DB and TEST_DB are built from POSTGRES_HOST_PORT rather than a literal 5432
-- an override that moved the container but left the connection strings behind
would be a knob that breaks things rather than fixing them. `make up` echoes
the ports actually in use.

Verified both ways: compose resolves the defaults and the overrides, and the
documented `make db && make test` runs green end to end on POSTGRES_HOST_PORT=5433
(90.0% coverage).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sahilkalgutkar
sahilkalgutkar merged commit a5b63c5 into main Sep 1, 2026
3 checks passed
@sahilkalgutkar
sahilkalgutkar deleted the fix/overridable-host-ports branch September 2, 2026 00:00
sahilkalgutkar added a commit that referenced this pull request Sep 2, 2026
Make every published host port overridable
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