
I'm trying to make code in a function be able to see a named volume declared in my docker compose or a bind mount also in my docker compose, the goal is for the function to work with some permanent files external to it.
I cannot make it see anything because these temp runtimes apparently are created and disposed dynamically instead of being declared in the docker compose file.
In my host I saw this /tmp/appwrite-executor-6575176f390e0cb6479b-662a67aaa7d9a3d3f2e0/src$ ls code.tar.gz hello.txt
So the folder "appwrite-executor-6575176f390e0cb6479b-662a67aaa7d9a3d3f2e0" is a folder created specifically for that function's deployment, each function version has one.
And in the container runtime I got /tmp: code.tar.gz hello.txt
The question is, where in Appwrite's code or declaration files I can mount a directory so my function sees another folder in the host? I have looked in Executor.php but apparently it is not handling that directly

You really shouldn't be doing this...

Something like this is an unsupported hack and may break in the future

I see

How else could this be achieved, for a function to see files external to it? I thought about other options but all of them seem disadvantageous. For example if I create a custom API container in the network just for that then I will lose the function's surrounding features like execution report etc. I really want to keep my code in there.

Why do you need this external file? What is it?

they're source code files for a dev version of a Sveltekit app. I want to programmatically make changes to them so they are immediately reflected through Sveltekit's standard hot module reloading.

I'm creating a web app editor

So user interacts with a GUI, appwrite function edits file according to that, web app changes. That's the flow.

They both live in the same server and same docker network

I tried named volumes at first but no way I could dynamically add one to the temp function container. Then I realized something similar to this happens with the host mount path, but I can't find where that is managed. I understand it is not an official API, I don't mind being "downstream" and modifying appwrite's source code or dockerfiles.

My first thought is storing it in a document instead

Yeah but then the web server loses the files 😅

The file would be locally managed and updated with data from the document

I don't see how the file would be accessible by the sveltekit server that way

I mean, I still* 😋

I will try to check out how the file storage works and report back

Maybe I'm missing some possibility there

Thanks for the attention!
Recommended threads
- SMTP Error: Could not connect to SMTP
My appwrite self-hosted instance on DigitalOcean cannot sennd emails. The following results were performed Log: ``` docker compose logs -f appwrite-worker-mail...
- Cannot create a user
Hi, I am using a lowcoder frontend and trying to create a user in Appwrite (python function). Unfortunately, all I got is an error: "Raw body: Error". It means...
- Invalid credentials after migration
Hi everyone! After migrating our self-hosted Appwrite 1.3.1 to another server (staging, so a different domain), we are now getting 'Invalid credentials' when ...
