You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the [AIChat.AppHost](AIChat.AppHost) project using the .NET Aspire tooling:
86
+
Run the application:
84
87
85
88
```bash
86
89
aspire run
87
90
```
88
91
89
-
This project uses [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview) to orchestrate the application components in containers.
92
+
This project uses [Aspire](https://aspire.dev) to orchestrate the application components in containers.
90
93
91
94
### Configuration
92
95
@@ -95,12 +98,43 @@ This project uses [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/
95
98
- The **PostgreSQL** database and **Redis** cache are automatically provisioned when running with Aspire.
96
99
- Access the Aspire dashboard to monitor resources and view logs.
97
100
101
+
### Deployment
102
+
103
+
To deploy the application using Docker Compose:
104
+
105
+
```bash
106
+
aspire deploy
107
+
```
108
+
109
+
This generates a Docker Compose configuration in the `aspire-output` directory and runs the application stack. The deployment includes:
110
+
111
+
- All application services (ChatApi, UI)
112
+
- PostgreSQL database with persistent volume
113
+
- Redis cache
114
+
- Configured networking between services
115
+
116
+
The application will be accessible at the configured ports, with all services orchestrated through Docker Compose.
117
+
98
118
## CI/CD
99
119
100
-
The project includes a GitHub Actions workflow that:
120
+
The project uses **Aspire's pipeline system** to build and publish container images. The custom `push-gh` pipeline step (defined in `PipelineExtensions.cs`) handles:
121
+
122
+
- Building container images through Aspire's build pipeline
123
+
- Tagging images with format: `<branch>-<build-number>-<git-sha>`
124
+
- Pushing images to GitHub Container Registry (GHCR)
125
+
126
+
The GitHub Actions workflow invokes the pipeline with environment variables:
127
+
128
+
```yaml
129
+
- name: Push to GitHub Container Registry
130
+
run: aspire do push-gh
131
+
env:
132
+
GHCR_REPO: ghcr.io/${{ github.repository_owner }}
133
+
BRANCH_NAME: ${{ github.ref_name }}
134
+
BUILD_NUMBER: ${{ github.run_number }}
135
+
GIT_SHA: ${{ github.sha }}
136
+
```
101
137
102
-
- Builds container images for both the API and UI
103
-
- Tags images with format: `<branch>-<build-number>-<git-sha>`
104
-
- Pushes images to GitHub Container Registry (GHCR)
138
+
The Aspire pipeline step reads these values, sanitizes the branch name for Docker compatibility, creates a semantic tag, and pushes the images to GHCR. This approach integrates seamlessly with Aspire's orchestration, allowing the AppHost to define both local development and CI/CD workflows in one place.
105
139
106
140
Images are available at: `ghcr.io/<owner>/chatapi` and `ghcr.io/<owner>/chatui`
0 commit comments