- 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 up
ordocker compose up -d
(build step not necessary once built)
- Create account if necessary
fly auth login
fly apps create <GLOBALLY-UNIQUE-APP-NAME>
- Update
app
property infly.toml
with
- Update
- Choose fly.io region
- Update
primary_region
property infly.toml
- Update
fly volumes create <VOLUME-NAME> -s 1 -r <REGION>
- Update
mounts.source
property infly.toml
with
- 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_TOKEN
secret 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 docker
docker push registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>
fly deploy --image registry.fly.io/<GLOBALLY-UNIQUE-APP-NAME>:<VERSION-NUMBER>