hoellen / docker-nextcloud

All-in-one Nextcloud Docker image. Alpine-based, rootless and simple.
31 stars 5 forks source link

DB_HOST variable not set for checking database availability #62

Open jazzdd86 opened 10 months ago

jazzdd86 commented 10 months ago

You moved the database check from startup to run.sh. There, you are checking for the variable DB_HOST - if this variable is empty you are defaulting to "nextcloud-db" - the default db name is not used in every installation.

Either you have to change your readme or get the host variable for the run.sh from the config.php file. Reason is, you wrote to delete those environment variables after initial setup in your readme - so normally this environment variable is not set anymore in the compose file and uses the default value.

hoellen commented 10 months ago

You can still remove the environment variables. If you do that, the check will not run because DB_TYPE is also empty and defaulting to "nextcloud-db" is no problem. I have moved the check only for those who have trouble with the database connection. They can specify the environment variables explicitly. The preferred way in my opinion is still to use the Docker health checks for this and not rely on this simple check in the bash script. Perhaps I should explain this in more detail in the README.