[ad_1]
Hello!
I am kinda confused on how to approach this.
Currently I have created a wp-config.php file in a docker container.
I also have a script that runs the following:
​
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.

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
You could set `WORDPRESS_CONFIG_EXTRA` as described in the container’s [readme]) for additional config variables. There is actually no need to change a WP container’s wp-config.php.