This repository demonstrates how to build, publish, and deploy a Aspire application to Docker Compose using the Aspire CLI. It includes both a C# minimal API and a Python FastAPI service.
- Clone the repository
git clone <repository-url>
cd <directory-name>- Run with Aspire
aspire runThis will start the Aspire dashboard and launch all services locally.
This repository showcases the complete Aspire deployment pipeline from development to production using Docker Compose. This process can be done in 3 progressive stages that generate more complete assets and deployment assets.
aspire publish --output-path publish-outputThis command:
- Generate a docker-compose.yaml from the app host
- Generate a
.envfile with expected parameters, unfilled - Outputs everything to the
aspire-outputdirectory
aspire do prepare-env --environment stagingaspire do prepare-env --environment productionThese commands:
- Generate a docker-compose.yaml from the app host
- Generate environment-specific
.envfiles with filed in values - Generates container images
- Outputs everything to the
aspire-outputdirectory
aspire deployThis final step:
- Generate a docker-compose.yaml from the app host
- Generate environment-specific
.envfiles with filed in values - Generates container images
- Outputs everything to the
prepare-env-{environment}directory - Runs
docker compose upagainst the generated files
The docker-compose-down-{env} step can be invoked to clean up the running Docker Compose instance.
aspire do docker-compose-down-env