fix: rewrite APP_ENV to prod in baked-in .env#435
Merged
Conversation
The committed .env defaults APP_ENV to dev for local development, but the API image only ships prod dependencies (composer install --no-dev). Tooling that reads .env directly without our docker-entrypoint.sh would bootstrap a dev environment that can't resolve its services. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tuj
approved these changes
May 6, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 6, 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.
Summary
The committed
.envdefaultsAPP_ENV=devfor local development. The API image only ships prod dependencies (composer install --no-dev), so any tooling that reads.envdirectly without going throughdocker-entrypoint.sh(which runscomposer dump-env prod) would try to bootstrap a dev environment that can't resolve its services.Files Changed
infrastructure/display-api-service/Dockerfile— added aRUN sedstep in theapi_app_builderstage that rewritesAPP_ENV=dev→APP_ENV=prodin the in-image.env, right after the full sourceCOPY. The source.envis untouched, so local dev keeps defaulting todev.CHANGELOG.md— entry under[Unreleased].Test Plan
docker build -f infrastructure/display-api-service/Dockerfile ..env:docker run --rm --entrypoint sh <image> -c 'grep ^APP_ENV= .env'— expectAPP_ENV=prod.composer dump-env prodandcache:warmupwithout errors.APP_ENV=devfrom the source.env(the file on disk is unchanged).🤖 Generated with Claude Code