From 5aabd74829554e780a2b56b8a8b88fef94aeb385 Mon Sep 17 00:00:00 2001 From: Denis Brumann Date: Sat, 6 Apr 2019 10:43:51 +0200 Subject: [PATCH 1/3] Fixes typo with reassigning env vars. Fixes #11304 --- setup/symfony_server.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index 1621be4e66c..142bf37a6a9 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -292,7 +292,7 @@ application, so you add the following to the ``.env.local`` file: .. code-block:: bash # .env.local - MYSQL_URL=${DATABASE_URL} + DATABASE_URL=${MYSQL_URL} # ... Now you can start the containers and all their services will be exposed. Browse From a4823c43495023937365d5054a040e68f546aa0e Mon Sep 17 00:00:00 2001 From: Denis Brumann Date: Sat, 6 Apr 2019 14:01:36 +0200 Subject: [PATCH 2/3] Rephrase paragraph for clarification. --- setup/symfony_server.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index 142bf37a6a9..585ca1fa3ed 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -283,11 +283,15 @@ autoconfigured): # RABBITMQ_DSN rabbitmq: ... -If you can't or don't want to update the service names, you must remap the env -vars so Symfony can find them. For example, if you want to keep a service called -``mysql`` instead of renaming it to ``database``, the env var will be called -``MYSQL_URL`` instead of the ``DATABASE_URL`` env var used in the Symfony -application, so you add the following to the ``.env.local`` file: +If you rename environment variables inside the +``docker-compose.yaml`` then you have to make sure Symfony is aware of this +change as well. For example if inside your ``docker-compose.yaml`` you define +``MYSQL_URL`` instead of ``DATABASE_URL``, +you have to make sure that in your Symfony project all occurences of this +environment variable are changed as well. A safer alternative to changing the +environment variable could be to reassign ``MYSQL_URL`` to ``DATABASE_URL`` +inside your ``.env.local`` to ensure that the name Symfony expected is actually +set: .. code-block:: bash From ef055979af5f3fdb06ce41cdeae331a78966d48c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 6 Apr 2019 15:58:10 +0200 Subject: [PATCH 3/3] Made the explanation more concise --- setup/symfony_server.rst | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/setup/symfony_server.rst b/setup/symfony_server.rst index 585ca1fa3ed..3dd82c2e7cf 100644 --- a/setup/symfony_server.rst +++ b/setup/symfony_server.rst @@ -283,15 +283,11 @@ autoconfigured): # RABBITMQ_DSN rabbitmq: ... -If you rename environment variables inside the -``docker-compose.yaml`` then you have to make sure Symfony is aware of this -change as well. For example if inside your ``docker-compose.yaml`` you define -``MYSQL_URL`` instead of ``DATABASE_URL``, -you have to make sure that in your Symfony project all occurences of this -environment variable are changed as well. A safer alternative to changing the -environment variable could be to reassign ``MYSQL_URL`` to ``DATABASE_URL`` -inside your ``.env.local`` to ensure that the name Symfony expected is actually -set: +If your ``docker-compose.yaml`` file doesn't use the environment variable names +expected by Symfony (e.g. you use ``MYSQL_URL`` instead of ``DATABASE_URL``) +then you need to rename all occurrences of those environment variables in your +Symfony application. A simpler alternative is to use the ``.env.local`` file to +reassign the environment variables: .. code-block:: bash