How to scale the storage using docker

Hi, I’m planning on offering nextcloud as a file storage for my business partners to store photos of clients and their documents.

We want to offer up to 150 GB of disk space for each user for free, with options to pay for more storage.

From my search, the hetzner storage boxes seem to offer the best storage value at £4 for 1 TB of disk space https://www.hetzner.com/storage-box.

I’m experienced with unionfs, and other merge filesystems. But i’d like to ask how the best approach would be to scale my /data mount of my docker.

I need a way to just keep buying more and more storage boxes as needed and increase the size of /data transparently for nextcloud.

I’d probably be using unionfs/mergefs and NFS/SMB to access the storage boxes. Would this give me any issue like latency or something?

What do you guys recommend? I don’t think I’ll ever go > 200 users and I don’t think they will even use the max storage… I’m looking for a solution that rely on inexpensive setup…

I think you are running your container in at a public webserver, otherwise i would recommend to move the docker volumes to an LVM based filesystem and reconfigure docker for the new filespace like this:

create a file for additional docker startup config
/etc/systemd/system/docker.service.d/docker.root.conf

adapt the parameters for your server/os-type in this file
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --graph="/media/myCloudDrive/docker" --storage-driver=overlay2

and finally restart docker system
systemctl daemon-reload
systemctl restart docker