-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to upload large static assets to heroku dyno? #12
Comments
Or what would be the steps to install cargo-web in addition to this buildpack, and then run it via |
This is a very good question, but I don't know the answer! You might try using a Good luck, and let me know what you figure out! |
Hmm, now that I've had a change to think about this more, this might be something we want to consider supporting directly somehow. But I mostly use |
Because building the frontend takes a long time, ideally it should also benefit from the build cache. The reason why the frontend should be built before the backend (and why the files have to be copied to #[derive(RustEmbed)]
#[folder = "target/deploy/"] // not possible to use $CARGO_TARGET_DIR/deploy here
struct Assets; I think the frontend building functionality could also be provided by a separate buildpack that runs before this, but it would have to be 95% identical with this one because it would also need to install The advantage of having the frontend building functionality in a buildpack instead of downloading the files at build time is that when using a shared crate for the API types, it always stays in sync between backend and frontend (just one deploy step), and there are fewer complications & expenses because everything runs on heroku instead of requiring another hosting provider. |
Thanks for creating the buildpack and this example :)
I'm using Rust also for my frontend, which I'm compiling to wasm with
cargo web deploy
.I need the generated files on my heroku dyno but I'd prefer to not include them in my git repo (same for other large assets like static images).
What's the best way to upload them so that I can serve them from my dyno's file system?
Basically the equivalent of scp'ing the files inside
target/deploy/*
.The text was updated successfully, but these errors were encountered: