Magento 2 env.php configuration -> what needs to be done to be compatible with docker containers of docker-magento #1168
-
Hi, I believe the tutorial needs an another section explaining the role of app/etc/env.php that Magento needs so the services are callable and how it must be edited to comply with the new docker containers architecture because if you are in the user case of installing an existing Magento 2 project, your existing env.php configuration is not compatible. In the end, it's a mandatory step if you want to finish the docker-magento installation (currently i can't go past the "bin/magento app:config:import" step because of if) and there is no explanation in how to do so. Can someone tell me if i'm wrong ? But for the other parameters, you either copy the values defined in files such as for the database /env/db.env into the Magento app/etc/env.php or you use in your app/etc/env.php a special syntax like "$_ENV['MAGENTO_REDIS_PORT']" that is capable of retrieving the variables defined in /env/*.env files. Is that correct ? But for some services like redis, app/etc/env.php is asking a for a password. But there is no password variable defined in /env/redis.env. In such scenarios where those informations are missing, how do i know the credentials of a given service inside one of the docker container. Is it always "magento" ? or if not specified, it means it's empty ? Thank you if you take the time to give me a response ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, To get answers to my questions, I did the whole automatic installation just to see what app/etc/env.php file it will produce. What do you guys think to use syntax like $_ENV['MYSQL_ROOT_PASSWORD'] instead of hard values in the app/etc/env.php. Just so that if we change the env/*.env files values, it will automatically update the values used by Magento once you restart the container, or i shouldn't bother for this rare use case ? |
Beta Was this translation helpful? Give feedback.
Hi,
To get answers to my questions, I did the whole automatic installation just to see what app/etc/env.php file it will produce.
no big surprise, it seems i guessed right.
What do you guys think to use syntax like $_ENV['MYSQL_ROOT_PASSWORD'] instead of hard values in the app/etc/env.php. Just so that if we change the env/*.env files values, it will automatically update the values used by Magento once you restart the container, or i shouldn't bother for this rare use case ?