that’s the wrong place. nothing that is changed during operation is allowed inside a container.
if you don’t put /var/www/html in a volume all your changes to your nextcloud will be gone with that container.
that indicates (to me) that in the new container the initial setup didn’t run. and you have a strange state. you have no config.php but you have a postgres database. so the initial setup fails because it can’t create the database. as far as i remember that is not cover by the script.
a script is doing this for you. when you look at the entrypoint.sh script of the nc docker image you’ll see that the update is done in that script (if needed). the script copies the nextcloud php files from /usr/src/nextcloud/ to /var/www/html/ with an rsync command.
in the file upgrade.exclude you can see what is not synced because these are user created/modified files. and therefore should not be over written. in line 49 the script checks if the directories exists and creates them if needed.
that looks bad. if config.php isn’t writeable by nextcloud you can’t do any changes to your nextcloud (that are store in the config.php) that includes update to another version.
hope that helps you find out the right configuration.
I am not getting it to work
I tried to stop mounting any custom settings and trigger the update script again, by modifying the versions.php and leaving it as 14.0.0
still keeps trying to connect to the database with a default username ignoring the environment variable. Unfortunately I have very little time to put on this.
I find very troubling that my data volume includes, basically, the whole nextcloud PHP code. this is not the idea behind the volumes. Being able to replace the container image while keeping the data is a key benefit of docker.
I am going to wipe the data volume and get a fresh install, as I have no data of value, I am mostly testing the viability of replacing my Synology by Nextcloud.