chore: consolidate per-app env files into a single .env + runtime host injection#99
Merged
Conversation
…t-a-glance clarity
BODMAT
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Collapses the env-template sprawl into one
.env+ one.env.exampleper app.Previously each app shipped a local example plus a near-duplicate
.docker.examplethat differed only in host names — every new variable had to be added in two or three
files and kept in sync by hand.
The single template now targets local (non-Docker) hosts. Docker hosts are injected
at runtime instead of being duplicated:
environment:overrides (compose.dev.yaml); prod addsNODE_ENV+ build args (compose.yaml). web:NEXT_PUBLIC_API_URL,NEXT_PUBLIC_TELEGRAM_BOT_ID. bot:API_URL→api,REDIS_URL→redis.scripts/test-env.cjsrewrites DB/Redis/Mongo hosts to theDocker service names for
:dxtest scripts.Every
.env.exampleis also split into banner-delimited REQUIRED (app won't bootwithout these) and OPTIONAL (safe defaults + feature toggles) blocks, so required
vs optional is obvious at a glance. Docs updated to match.
Deleted:
apps/*/.env*.docker.example(api, api test, web, bot).Real
.env/.env.dockerremain gitignored — only.examplefiles are committed.Closes #98
Type of change
How Has This Been Tested?
Unit tests (Jest/Vitest)
Integration tests
Manual testing (screenshots/screencasts encouraged)
ran
bash dx run test:api:light:dx— host rewrite viascripts/test-env.cjsresolves
postgres/rediscorrectly; suite greenbrought up dev stack (
bash dx dev) — api, web, bot connect using Composeenvironment:host overrides from the single.envverified no variables were dropped vs the old templates and that example/test diffs are intended functional lines only
Checklist: