- Rust version 1.78.0 or greater installed
- NodeJS version 20 or greater installed
- Install Node dependencies
npm install - Build web with
npm run build - Install Rust dependencies
cargo install - Build with
cargo build - Run with
cargo run
- Docker and Docker Compose or compatible software installed.
- Create volume with
docker volume create db-data - Build with
docker build -t rust-web-demo . - Run with
docker run -itd -p 8080:8080 -v db-data:/data rust-web-demo
- Build with
docker compose build - Run with
docker compose upordocker compose up -d(build step not necessary once built)
- Create account if necessary
fly auth loginfly apps create <GLOBALLY-UNIQUE-APP-NAME>- Update
appproperty infly.tomlwith
- Update
- Choose fly.io region
- Update
primary_regionproperty infly.toml
- Update
fly volumes create <VOLUME-NAME> -s 1 -r <REGION>- Update
mounts.sourceproperty infly.tomlwith
- Update
docker build -t registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER> --target deploy .fly deploy --image registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>
Automated deployment of new versions with GitHub action
- Set up your
FLY_API_TOKENsecret in your repository - Tag release with a tag name starting with 'v'
- Example:
git tag -a v2 -m "My new release!" && git push --tags
- Example:
docker build -t registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER> --target deploy .fly auth dockerdocker push registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>fly deploy --image registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>