This is an example app for Cloudron, using the Rocket framework.
License: anything you like (commercial or not). I claim no ownership over any of this, as it's too trivial to :)
- Make sure you have Rust installed.
- Rocket requires a nightly toolchain,
so you may have to run
rustup override set nightly
if you aren't using that for everything. - I've chosen to use static linking to make deployment easier, so you will need to install the right target:
rustup target add x86_64-unknown-linux-musl
cargo check --target x86_64-unknown-linux-musl
cargo test --target x86_64-unknown-linux-musl
cargo build --target x86_64-unknown-linux-musl --release
First, build the application as shown above. Then, prepare the deploy directory:
export DEPLOY_DIR="./tmp-deploy/"
rsync -rav --delete \ ./Rocket.toml \ ./start.sh \ ./target/x86_64-unknown-linux-musl/release/cloudron-rust-rocket \ ./static \ ${DEPLOY_DIR}
Then go ahead and build and tag the docker image.
TODO
cloudron install / cloudron update blurb here