I want to deploy Nextcloud using the community docker image (fpm) such that the main data
, config
and custom_apps
directories are stored on a network attached / mounted storage. Here is the docker-compose.yml
file:
services:
db:
image: mariadb:11.1.2
…
networks:
- nextcloud
app:
image: nextcloud:27.1.3-fpm
restart: always
volumes:
- nc_root:/var/www/html
- /mnt/nextcloud/nextcloud/nc_data:/var/www/html/data
- /mnt/nextcloud/nextcloud/nc_config:/var/www/html/config
- /mnt/nextcloud/nextcloud/nc_apps:/var/www/html/custom_apps
networks:
- nextcloud
web:
image: nginx:1.25
restart: always
ports:
- 80:80
- 443:443
volumes:
- nc_root:/var/www/html
- /mnt/nextcloud/nextcloud/nc_data:/var/www/html/data
- /mnt/nextcloud/nextcloud/nc_config:/var/www/html/config
- /mnt/nextcloud/nextcloud/nc_apps:/var/www/html/custom_apps
networks:
- nextcloud
Right now /mnt/nextcloud/nextcloud
is an ordinary directory on an ordinary device which is ordinarily mounted - I guess its an ext4
filesystem.
WHAT I WANT TO DO: mount -t davfs https:… /mnt/nextcloud/…
such that all the data that is produced by Nextcloud - in best case including the database data - is finally located on the File Server.
I have tried that already, but it didn’t work because:
- the database didn’t start cause of permission errors
- without the database data directory mounted I got a lot of
404
s especially for stuff comoing fromcustom_apps/*
like icons and so forth.
Is there any resource link, how to, best practice or alike that explains a setup similiar to that one? My Goal is to keep the data off the application server. But the problem is, that the Fileserver is not on the same LAN / Network, so all the files travel the www
. The connection is OK, so some latency my occur and would be acceptable.
Thanks for Help!