Skip to content

fix: rewrite APP_ENV to prod in baked-in .env#435

Merged
turegjorup merged 2 commits into
release/3.0.0from
feature/dockerfile-app-env-prod
May 6, 2026
Merged

fix: rewrite APP_ENV to prod in baked-in .env#435
turegjorup merged 2 commits into
release/3.0.0from
feature/dockerfile-app-env-prod

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

The committed .env defaults APP_ENV=dev for local development. The API image only ships prod dependencies (composer install --no-dev), so any tooling that reads .env directly without going through docker-entrypoint.sh (which runs composer dump-env prod) would try to bootstrap a dev environment that can't resolve its services.

Files Changed

  • infrastructure/display-api-service/Dockerfile — added a RUN sed step in the api_app_builder stage that rewrites APP_ENV=devAPP_ENV=prod in the in-image .env, right after the full source COPY. The source .env is untouched, so local dev keeps defaulting to dev.
  • CHANGELOG.md — entry under [Unreleased].

Test Plan

  • Build the image: docker build -f infrastructure/display-api-service/Dockerfile .
  • Inspect the baked-in .env: docker run --rm --entrypoint sh <image> -c 'grep ^APP_ENV= .env' — expect APP_ENV=prod.
  • Boot the container normally and confirm the entrypoint still runs composer dump-env prod and cache:warmup without errors.
  • Confirm local dev compose stack still picks up APP_ENV=dev from the source .env (the file on disk is unchanged).

🤖 Generated with Claude Code

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>
@turegjorup
turegjorup requested a review from tuj May 6, 2026 09:56
@turegjorup turegjorup self-assigned this May 6, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@turegjorup
turegjorup merged commit 456dcd5 into release/3.0.0 May 6, 2026
17 checks passed
@turegjorup
turegjorup deleted the feature/dockerfile-app-env-prod branch May 6, 2026 10:55
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.

2 participants