@@ -126,21 +126,29 @@ While developing locally, you'll usually store these in ``.env`` and ``.env.loca
126126
1271271. Create "real" environment variables. How you set environment variables, depends
128128 on your setup: they can be set at the command line, in your Nginx configuration,
129- or via other methods provided by your hosting service.
129+ or via other methods provided by your hosting service;
130130
131- 2. Or, create a ``.env.local `` file like your local development (see note below)
131+ 2. Or, create a ``.env.local `` file like your local development.
132132
133133There is no significant advantage to either of the two options: use whatever is
134134most natural in your hosting environment.
135135
136- .. note ::
136+ .. tip ::
137+
138+ You might not want your application to process the ``.env.* `` files on
139+ every request. You can generate an optimized ``.env.local.php `` which
140+ overrides all other configuration files:
141+
142+ .. code-block :: terminal
143+
144+ $ composer dump-env prod
137145
138- If you use the ``.env.* `` files on production, you may need to move your
139- `` symfony/dotenv `` dependency from `` require-dev `` to `` require `` in `` composer.json `` :
146+ The generated file will contain all the configuration stored in ``.env ``. If you
147+ want to rely only on environment variables, generate one without any values using :
140148
141149 .. code-block :: terminal
142150
143- $ composer require symfony/dotenv
151+ $ composer dump-env prod --empty
144152
145153 C) Install/Update your Vendors
146154~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments