WordPress wp-config.php env variables issue

Hello!
I am kinda confused on how to approach this.
Currently I have created a wp-config.php file in a docker container.

[Image above shows the information in the file.](https://preview.redd.it/1aaly46njq1a1.png?width=1052&format=png&auto=webp&s=a0044b127feb3ac5a2da15db98da617e645ad0ca)

I also have a script that runs the following:

https://preview.redd.it/u0wo46uujq1a1.png?width=1196&format=png&auto=webp&s=d0f3858aa942fcfe1b53a47c0ba5b10e3e17cbb9

​

I am using the latest WP image and it has apache2 on it.
What should I write in the wp-config in order to pass the env variables from the script.
\*YES I KNOW\* that the script adds ” as env’s in this above example , but It needs to be dynamic as I can change it anytime.

2 Comments
  1. Assuming that USER_DB, PASS_DB etc are the credentials for the database that you want to use for WordPress, you should either:

    change your script so that USER_DB becomes WORDPRESS_DB_USER (and the other variables are changed to match what’s expected by wp_config.php

    OR

    edit wp-config.php so that the line becomes: define(‘DB_NAME’, getenv(‘USER_DB’, ‘mysql’));

    …and so on for the other variables

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer