Passing env variables to WordPress from apache?

Hey ,
Has anyone here tried passing environmental variables from apache (/etc/apache2/envvars) to wordpress to automate the whole setup of wordpres?

Currently I am working on a container (Docker) that has a WP image and I’ve added some extra commands to run a script that fills the envvars file with secrets (db credentials) .
However I am not quite sure how to add them to WordPress so it can automatically populate them .

Any suggestions would be highly appreciated!


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