Speedrun
First, install flyctl, the Fly.io CLI, and sign up to Fly.io if you haven’t already. The fastest way to get a basic Rocket server on Fly.io is to use our rocket template:Deploy a Rocket App from scratch
If you don’t already have an existing Rocket application, you can create one withcargo:
rocket dependency to the project:
src/main.rs:
127.0.0.1 and port 8000, these are the defaults for rocket. When deploying the app these defaults will be overridden using environment variables which you can find in the fly.toml.
We can confirm everything works fine by running cargo run and checking out http://localhost:8000.
And with that you can deploy the app!
fly.toml file with the configuration for your app and a Dockerfile that uses cargo chef.
Refer to the fly.toml docs for more configuration options.
To deploy a new version of your app, simply run fly deploy in the project directory.
You can check out the full (yet minimal) example in this GitHub repository for a reference.