Back

Adding DO volume to Appwrite Docker containers

  • 0
  • Self Hosted
Ryan
5 May, 2024, 16:08

I am running Appwrite on a DigitalOcean Droplet with 160GB, with my buckets running on DO Spaces so they're not included at all here. I have ended up hitting the limit of storage on the Droplet and am looking to connect block storage volumes to the Droplet as a way to expand the capacity without having to essentially double the cost of the Droplet but wasn't sure how that would work with getting the Appwrite containers to use the block storage mounted path

TL;DR
Developers want to add DO volume to Appwrite Docker containers. To do this, they should add object storage drive, create a symlink, and change the volume to a mounted local folder in the server. They may need to delete the old volume manually and move the current cache files as well. They can adjust the `docker-compose.yml` file to include the mounted drive as the local driver options for the `appwrite-cache` volume. In case of oversized folders causing space issues, developers should identify and mount them using fstab. The developer is exploring ways to connect block storage volumes to the DigitalOcean Droplet to expand the capacity without
Binyamin
5 May, 2024, 16:12

That can be a bit tricky,

First, try to spot the over-sized folder, meaning, find what causes that you're out of space.

Second, after you've spotted it you'll need to mount that folder using fstab

Ryan
5 May, 2024, 16:14

It looks like it's my appwrite-cache container that's using ~105GB, I don't support there would be a way to set just that container up to use the mounted storage instead?

Binyamin
5 May, 2024, 16:15

Yes, you can

Binyamin
5 May, 2024, 16:15

You'll need to make a few changes

Binyamin
5 May, 2024, 16:16

But, why is it takes so much space?

Ryan
5 May, 2024, 16:16

We've got about 60-70k users on a very image heavy website, so I'm expecting it'll be a lot of image preview caches

Binyamin
5 May, 2024, 16:16

Alright

Binyamin
5 May, 2024, 16:20

There are few ways to tackle it

Ryan
5 May, 2024, 16:21

Having a look at docker-compose.yml I'm assuming that it should just be the case of adding the mounted drive as the local driver options for the appwrite-cache volume that's defined in docker-compose.yml?

Binyamin
5 May, 2024, 16:25

The fastest way would be:

  1. Add object storage drive
  2. Create a symlink of it You new drive would be inside /mnt/drivename Create the symlink like so, for exmaple inside home/cache
TypeScript
ln -s /mnt/drivename /home/cache
  1. Change volume to mounted, to a local folder in your server, like so
TypeScript
volumes:
  appwrite-mariadb:
  appwrite-redis:
  appwrite-cache:
    driver: local
    driver_opts:
      type: volume
      o: "bind"
      device: "/home/cache"    

And reload your docker compose, From now one all files would be created inside that folder that it's actually the attached object one.

Notes.

  • You might need to delete the old volume manually, find is location by running docker volume inspect appwrite-cache
  • All of the current cache would be irelevant, again you can move it manually.
Ryan
5 May, 2024, 16:41

That's perfect, thank you! I'm going to give this a go later tonight and will let you know how it goes

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more