From ca512a845cbaf06538426779f14006ffe7aff179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20V=C3=AEjial=C4=83?= Date: Fri, 13 Oct 2023 18:06:02 +0300 Subject: [PATCH] README.md - specify envs are not read after installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/nextcloud/server/issues/40904 Signed-off-by: Gabriel Vîjială --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index a4592d70..586c318b 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,22 @@ Check the [Nexcloud documentation](https://docs.nextcloud.com/server/latest/admi Keep in mind that once set, removing these environment variables won't remove these values from the configuration file, due to how Nextcloud merges configuration files together. +## Changing database connection options after installation + +At installation time, the values are taken from the environment variables above and saved into the `config.php` file. Changing these envrionment variables after installation will not change the `config.php` file, and will not be picked up at runtime. + +If one of these values needs to change, for example `MYSQL_HOST`, one must either manually edit the `config.php` file, or create a new custom configuration file (for example, `config/dbhostoverride.config.php`) with content: + +``` + getenv('MYSQL_HOST'), +); +``` + +And add keys to this file for each value expected to change (dbhost, dbport, passwords, etc). + + # Running this image with docker-compose The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples of what you have to look for.