Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Deployment] Update deployment docs with new .env files logic #13084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,29 @@ While developing locally, you'll usually store these in ``.env`` and ``.env.loca

1. Create "real" environment variables. How you set environment variables, depends
on your setup: they can be set at the command line, in your Nginx configuration,
or via other methods provided by your hosting service.
or via other methods provided by your hosting service;

2. Or, create a ``.env.local`` file like your local development (see note below)
2. Or, create a ``.env.local`` file like your local development.

There is no significant advantage to either of the two options: use whatever is
most natural in your hosting environment.

.. note::
.. tip::

You might not want your application to process the ``.env.*`` files on
every request. You can generate an optimized ``.env.local.php`` which
overrides all other configuration files:

.. code-block:: terminal

$ composer dump-env prod

If you use the ``.env.*`` files on production, you may need to move your
``symfony/dotenv`` dependency from ``require-dev`` to ``require`` in ``composer.json``:
The generated file will contain all the configuration stored in ``.env``. If you
want to rely only on environment variables, generate one without any values using:

.. code-block:: terminal

$ composer require symfony/dotenv
$ composer dump-env prod --empty

C) Install/Update your Vendors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down