How does shuttle deployment store files?
# help
t
Hey! 🐻 I have an "upload server" project called **rustypaste**: https://github.com/orhun/rustypaste I'm trying to deploy it to shuttle and I actually managed to do it: https://rustypaste.shuttleapp.rs However, since I don't exactly know how shuttle works, I'm curious how it happened out of the box. For example, now you can upload files like this:
Copy code
curl -F "file=@Cargo.toml" https://rustypaste.shuttleapp.rs
Internally, are they uploaded inside an isolated container? If so, is there any disk/memory/cpu limits? Is there any documentation about this? Thank you for this great project!
e
hmm. Docs list the RAM and CPU count, but not more details that I can see rn
t
where exactly that is stated?
also how about disk space 🤔
g
Your project runs in a docker container, but writing to the file system is not recommended, since the container is wiped when you do
cargo shuttle project restart
(which you do when upgrading shuttle version, or when things break). For persistent storage, you want to use some form of database. You can check the supported ones on the docs, but there are also more of them in the works.
t
thanks for your answer @gentle-ice-1561 I'm planning to auto-expire the files after one hour or so would you recommend using the filesystem in this case? also, is there a disk usage limit?
g
Yeah, for that use case it works fine then I guess 😄
I can check the disk space, but there are probably no guarantees there.
t
alright
I just don't want to upload a 10GB file and put you in a difficult situation :D
g
It uses a Docker volume, but I'm struggling to find if there is any limit set.
a
Yeah I don't think it's persistent - it would be much better to just use some kind of r2/s3 bucket then have an API key system for retrieving images
t
it seems like the disk space available to the docker containers can be limited via
--storage-opt
option
fwiw
b
With the blog post out, rustypaste seems ready for #968836095821373441 😉
I did just try to go to the live app though and I got > could not find service: rustypaste
g
hmm, seems to be working on my end
b
Ah, worked now upon refresh 👌
g
I think that happens when the service wakes form timeout 😕