Skip to content

Add .env.example for the host port overrides - #22

Merged
sahilkalgutkar merged 1 commit into
mainfrom
chore/env-example
Sep 9, 2026
Merged

sahilkalgutkar merged 1 commit into
mainfrom
chore/env-example

Conversation

@sahilkalgutkar

Copy link
Copy Markdown
Owner

The gap

Every other compose-based repo here ships a .env.example. This was the only one where the three port variables existed but no file listed them, so the README table was the only place to find them. I hit this myself: make db failed on a taken 5432 and the variable name had to be dug out.

Why it needed more than a new file

The compose file lives in deploy/, so compose looks for deploy/.env and would never read one at the repo root. Worse, the Makefile exports the port defaults, and a shell variable beats compose's .env — so a file dropped in deploy/ would have been silently ignored whenever anything ran through make. A .env.example on its own would have been decorative.

The Makefile now reads .env itself and resolves each port as environment, then .env, then the default:

Case Result
nothing set 5432
.env sets 5433 5433
.env sets 5433, inline says 5599 5599

All three verified with make -p.

.env is now gitignored, matching the four sibling repos that ship an example.

End-to-end check

Copied the example to .env, set POSTGRES_HOST_PORT=55433, ran make db with no inline variable:

postgres [{0.0.0.0 5432 55433 tcp}]

The DB-backed suites then passed against that port, confirming the connection strings follow the override too.

Every other compose-based repo here ships one; this was the only one where the
three port variables existed but had no file listing them, so the README table
was the only place to find them.

The compose file lives in deploy/, so compose looks for deploy/.env and would
never read one at the root -- and the Makefile's exports would win over it in
any case. The Makefile now reads .env itself, resolving each port as
environment, then .env, then the default, so an inline POSTGRES_HOST_PORT=5433
still beats a value sitting in the file.

.env is gitignored, matching the other repos that ship an example.

Verified by copying the example to .env, setting 55433 and running make db with
no inline variable: Postgres published on 55433 and the DB-backed suites passed
against it.
@sahilkalgutkar
sahilkalgutkar merged commit bc3f82a into main Sep 9, 2026
2 checks passed
@sahilkalgutkar
sahilkalgutkar deleted the chore/env-example branch September 9, 2026 17:21
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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