Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommendations on Using s3backer with Docker? #155

Open
elsiehupp opened this issue Nov 14, 2021 · 2 comments
Open

Recommendations on Using s3backer with Docker? #155

elsiehupp opened this issue Nov 14, 2021 · 2 comments

Comments

@elsiehupp
Copy link

Hi s3backer Folks!

I am currently in the process of migrating my personal Nextcloud away from Nextcloud's first-party S3 support because of its incompatibility with encryption, which you can read about in this issue thread here. In the thread, Jivan Pal suggests using s3bracker instead.

I am also trying to migrate from the Nextcloud Snap appliance to the Nextcloud Docker appliance, because the Snap has some annoying limitations. (Among other things, it doesn't support URL rewrites and it doesn't support Apache virtual hosts for more than one appliance per VPS.) My hope is that the Docker appliance will be as low-maintenance as the Snap appliance, as compared to being able to manage all the components manually.

Anyway! The Nextcloud Docker readme lists the following as data volumes, i.e. what I could use with s3backer:

If you want to get fine grained access to your individual files, you can mount additional volumes for data, config, your theme and custom apps. The data, config files are stored in respective subfolders inside /var/www/html/. The apps are split into core apps (which are shipped with Nextcloud and you don't need to take care of) and a custom_apps folder. If you use a custom theme it would go into the themes subfolder.

Overview of the folders that can be mounted as volumes:

  • /var/www/html Main folder, needed for updating
  • /var/www/html/custom_apps installed / modified apps
  • /var/www/html/config local configuration
  • /var/www/html/data the actual data of your Nextcloud
  • /var/www/html/themes/<YOUR_CUSTOM_THEME> theming/branding

If you want to use named volumes for all of these, it would look like this:

$ docker run -d \ -v nextcloud:/var/www/html \ -v apps:/var/www/html/custom_apps \ -v config:/var/www/html/config \ -v data:/var/www/html/data \ -v theme:/var/www/html/themes/<YOUR_CUSTOM_THEME> \ nextcloud

On the other hand, Docker recommends using volumes rather than bind mounts. Is s3backer something I would use in this scenario? If so, do you have any recommendations as to how?

Thanks!

Best,
Elsie Hupp

P.S. I'm cross-posting this to the s3backer-devel mailing list because I'm not sure which of these is a better place to post this, and I'll link between the two threads.

@aaruni96
Copy link

Nextcloud has its files in the data folder.

The directory structure is as follows :
/var/www/html/data/$USERNAME/{cache,files,files_trashbin,files_versions,uploads}

The easiest way to use s3backer would be to have /var/www/html/data be an s3backer backed filesystem. In my testing for my own setup (not docker), this results in extremely poor performance.

My recommended setup for using s3backer with Nextcloud is to have /var/www/html/data be on the local filesystem.
Then have only /var/www/html/data/$USER/{files,files_versions,files_trashbin} be on s3backer.

So, when a user uploads a file, it is uploaded to the uploads folder, which is on the local filesystem. This is then moved to the files folder at server's leisure, and latency here is acceptable.
For similar reasons, I keep cache on the local filesystem.

I am not sure if docker allows adding volumes in the configuration to meet this specific requirement, as I don't use it, but you should be able to use a mix of docker volumes and bind mounts to achieve this.

@semhoun
Copy link

semhoun commented Jan 6, 2022

Hello,

I'm doing same thing as you, but i do differents structures:

  • I modify the nextcloud to put cache outside the data ('cache_path' => '/var/www/html/cache')
  • I use s3backer for the whole data directory but i do a mout --bind for appdata_XXXX, files_encryption and updater-XXXX
    With this configuration new accout will be on s3bucket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants