Using Fly volumes as Laravel filesystems

I am currently thinking whether it’s possible to use a volume on fly as a filesystem with laravel so we can directly save files and use volumes as filesystems.

As far as I know, fly volumes don’t necessarily have APIs to access them unlike s3 or azure blobs which provides APIs for interacting with them. I assume this might have to be something that fly has to make possible.

So I am basically making a suggestion here if fly could make that available, I think it will be really good, so we can just store our files also on a separate volume without worrying about using s3 or cloudinary or any other external storage system.

Perhaps there’s also a way to do this that I have not found yet so if you know of any such way too, then please let me know.

2 Likes

I’m pretty sure this is all you need! File Storage - Laravel - The PHP Framework For Web Artisans

Just point the filesystems config file to /data or whatever path you’re using to mount your volume.

1 Like

Hi @discoverlance!

As @kurt mentioned, you can opt to use the local filesystem, and this way files will be stored in your storage directory. Then you can mount a Volume to the storage directory in a similar manner as given in this guide, persisting your stored files.

If you’d prefer to keep your files separate from your main application, while still keeping a “full” Fly.io apps-stack, maybe you can experiment with a separate “File System” Fly App–deploy a Laravel Fly App with Volume mounted on storage, providing apis for storing and retrieving files–then other Fly applications which are hopefully deployed in the same region, will store files by talking to your “File System” fly app. You might even opt to use the fly-replay response header to easily talk from your other Fly Apps to your File System Fly app

That would be pretty cool!

1 Like

This looks like a good object storage app to deploy on Fly: Deploy MinIO Object Storage to Fly.io · Fly Docs!