Hi all.
I want to run Nextcloud Docker container on my Cloud-Server.
Space is a bit limited here for me, and as I expect that the NC Data and the Database will get quite big over time, I want to put those files on an NFS share of my storrage-system.
How needs docker-compose.yaml to be modified so I can store:
my files on NFS-Share mounted to /data/nextcloud/files
Well thereās nothing in the logs that offers any hint on what went wrong:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message
[Sun Feb 10 15:19:26.056683 2019] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.14 configured -- resuming normal operations
[Sun Feb 10 15:19:26.057565 2019] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
But when you try to open the home-page, you get:
Warning: require_once(/var/www/html/lib/versioncheck.php): failed to open stream: No such file or directory in /var/www/html/index.php on line 36
Fatal error: require_once(): Failed opening required '/var/www/html/lib/versioncheck.php' (include_path='.:/usr/local/lib/php') in /var/www/html/index.php on line 36
And you get this error simply because the dir/files are not present in the volume. And yes, the files are present in the containerā¦
The problem here seems that - for some reason - the volume is not ready when the Dockerfile (inside the container) tries to copy ācertainā files to the dest. location ā¦ or has some permission problems ā¦ but there is no clue/hint in any logs ā¦
Ok ā¦ after reading this: https://github.com/moby/moby/issues/17470 and this: https://github.com/moby/moby/issues/21728 I think I found the reason why those files do not appear in the volumes.
But that would put the whole nextcloud-docker thing in jeopardy over its general usability ā¦
I mean ā¦ if all changes getting discarded how could you have a workin DB inside a volume/bind-mount ?
Still my orininal question remains: I need to store the apps/data and DB on a NFS-share ā¦ how can this be achived ?
is the folder /data/nextcloud/files on the host empty?
the rsync in line 47 is responsible for copy the nextcloud file"in place" at first container start.
As a former NFS sysadmin, I strongly recommend that you donāt do that. If you want HA (High Availability) for your Nextcloud database and data, then you should have RAID in the Nextcloud server itself. Donāt put the Nextcloud database or data on an NFS mount, especially if itās Linux NFS. Linux NFS isnāt as robust as Solaris NFS. Iāve administered both professionally. In my experience, once too much strain was placed on Linux NFS, it cracked under pressure, and itās very hard to debug. There was little active development on Linux NFS. At least you should test very thoroughly, placing a heavy simulated load on it, before you trust it.
Please donāt allow Linux NFS to be a point of failure for your Nextcloud server.
Donāt ācheap outā on your Nextcloud server. If you need RAID, then dang it, give your Nextcloud server proper RAID (or maybe use Network-attached storage at the block level, not the NFS level, if you really want to kick it up a notch).
iām not sure. but i think you donāt need that in your docker-compose file. you map the container folders to folders on your host. instead of using the volumes.
with this only the files that need to be persistent are store on the hosts filesystem. and you only need to put /data/nextcloud/files to the nfs share. because thatās the folder with your files. all other folders wonāt grow that much.
and i also wouldnāt put the database on the nfs share. normally the database isnāt that large.