-
-
Notifications
You must be signed in to change notification settings - Fork 864
Description
Problem
The Dockerfile has hardcoded ENV APP_ENV=dev
(for dev stage), and the compose.override.yaml
also passes the APP_ENV
to the container as environment variable.
When you start up the service (with docker compose up -d
), it will pass the APP_ENV
(from the .env
) to the container through the compose.override.yaml
(and defaults to dev
if not set).
As real environment variables will always have precedence over dotenv variables, this means that even when the APP_ENV
changed from dev
to prod
in the .env
, it will not take effect until the docker container is recreated.
The behavior of APP_ENV
is counter-intuitive with regards on how Symfony normally handles this, because normally when changes are made in the dotenv files, these changes are reflected immediately (in the next request). The Dockerfile/compose config should not pass environment variables that are also used in Symfony dotenvs for development purposes.
Suggestion
- Remove
ENV APP_ENV=dev
from thefrankenphp_dev
stage.- The
ENV APP_ENV=prod
can probably be kept.
- The
- Remove
APP_ENV: "${APP_ENV:-dev}"
fromcompose.override.yaml