[Deployment] Update deployment docs with new .env files logic #13084
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.
The changes from last year regarding how the
.envfiles are loaded can affect production deployments. Vendors like Heroku give recommendations based on documentation that no longer applies: "It is recommended that you do not use the symfony/dotenv package in production".The
symfony/dotenvhas been moved fromrequire-devtorequire, so the note I removed in this PR no longer applies: symfony/skeleton#122 , symfony/website-skeleton#132 and symfony/demo@7ead1e4 . Loading.envfiles in production will work without any changes in composer.json.Putting
symfony/dotenvinrequire-dev(or not moving it torequireduring an upgrade from older versions of Symfony & recipes) can potentially break your app: if the DotEnv class is missing, theconfig/bootstrap.phpfile inside the FrameworkBundle's recipe will throw a RuntimeException . Also see symfony/recipes#501The note now contains the right way to handle these files in production, by using
$ composer dump-env prodin case you do not want the.envfiles to be processed on every request, also suggesting the--emptyflag if you want to rely exclusively on "real" environment variables .