`settings.php` override variables - how are they set?
Closed this issue · 1 comments
rosiel commented
Trying to understand what seems to be a complex chain of how the config override variables are controlled.
- In my settings.php file there are lines like
$config['islandora.settings']['broker_url'] = file_get_contents($path . 'DRUPAL_DEFAULT_BROKER_URL');
- That line was originally in
[drupal root]/assets/patches/default_settings.txt
in the site template (which during installation of the site template, is copied over the contents ofdefault_settings.txt
from the starter site). Due to a line in composer.json of the starter site, this file becomes the basis ofsettings.php
. file_get_contents($path . 'DRUPAL_DEFAULT_BROKER_URL')
means to get the contents of a file.$path
is defined above this line as/var/run/s6/container_environment/
. That path is not populated by the starter site or the site template as far as I can tell.- Are the contents of /var/run/s6/container_environment/ set by dumping all environment variables there (done by a special command using s6)? Does it only happen if we're using a reverse proxy?
- Do the values themselves come from the values in Buildkit's Drupal Dockerfile? Where are some of them overridden so that it's not all islandora.traefik.me? Is it the lines in isle-site-template's docker-compose file? Do they overwrite (one-by-one) or replace (all)?
nigelgbanks commented
For point 3. The files are created by the process manager s6. A file is created for each environment variable embedded in the docker image or passed in at run time.
For point 4. s6
does it as part of its startup. It's not something we control, though we do modify some environment variables in some specific cases, as the link you provided shows.
For point 5. They come from the Docker containers environment variables. These can be specified in the Dockerfile
or they can be passed in when the container starts from the command line or from docker compose
. The latter takes precedence.