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
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Migrate from cloud to localhost
Hello everyone. I need to migrate my test project from cloud to localhost, however it seems that this is possible only if a self-hosted appwrite instance it's h...