The .NET Aspire Manifest
.NET Aspire isn't opinionated about deployment. What it does instead is it allows us to grab a manifest file that describes everything about our system. This means that other tooling can read that manifest file and use it to automate infrastructure provisioning and deployments.
Generating the manifest.json
To generate the manifest.json, navigate to the AppHost project and run this command:
dotnet run -- --publisher manifest --output-path ./manifest.json
Let's take a look at the generated file.
Using Aspirate
Aspirate is a CLI tool that makes working with .NET Aspire via the CLI incredibly easy and it adds some game changing features into the mix.
You can install it using the following command:
dotnet tool install -g aspirate
Generating a docker-compose.yml
Let's use Aspirate to generate a docker-compose.yml file for our entire system. Aspire will inspect the AppHost project and do all the hard work for us.
Simply run the following:
aspirate generate --output-format compose
Navigating to aspirate-output will reveal the new docker-compose.yml
file.
Before we run it we need to add connection strings for our cloud-only technologies.
Once we do that we can just run docker compose up
and see our system including the dashboard come alive!