Skip to content

Commit 28ed09e

Browse files
authored
refactor: containerize Angular SPA with Docker Compose frontend profile and fix healthchecks (#70)
* feat: add Dockerfile and nginx config for SPA containerization * refactor: simplify docker-compose with YAML anchors, default network, and add SPA frontend profile * fix: install curl in all .NET Dockerfiles for healthcheck support * chore: remove explicit Microsoft.OpenApi dependency * refactor: use wildcards to exclude paths * docs: document Docker frontend profile and SPA local development
1 parent f495b22 commit 28ed09e

File tree

17 files changed

+178
-247
lines changed

17 files changed

+178
-247
lines changed

Directory.Packages.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
<ItemGroup Label="API Documentation">
2424
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerGen" Version="10.1.0" />
25-
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.1.0" />
26-
<PackageVersion Include="Microsoft.OpenApi" Version="2.3.0" />
25+
<PackageVersion Include="Swashbuckle.AspNetCore.SwaggerUI" Version="10.1.0" />
2726
</ItemGroup>
2827

2928
<ItemGroup Label="API Versioning">
@@ -33,7 +32,7 @@
3332

3433
<ItemGroup Label="API Gateway">
3534
<PackageVersion Include="Ocelot" Version="24.1.0" />
36-
<PackageVersion Include="Koalesce" Version="1.0.0-beta.1" />
35+
<PackageVersion Include="Koalesce" Version="1.0.0-beta.5" />
3736
</ItemGroup>
3837

3938
<ItemGroup Label="Event Sourcing and Messaging">

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
An experimental full-stack application showcasing cutting-edge technologies and architectural patterns for building scalable e-commerce systems.
44

5-
**If you find this project useful, please consider giving it a star!** It helps others discover the project.
5+
**If you find this project useful, please consider giving it a star!** It helps others discover the project. ![GitHub Stars](https://img.shields.io/github/stars/falberthen/ecommerceddd?style=social&logo=github)
66

7-
![GitHub Stars](https://img.shields.io/github/stars/falberthen/ecommerceddd?style=social&logo=github)
7+
![.NET](https://img.shields.io/badge/.NET-10-512BD4?logo=dotnet) ![Angular](https://img.shields.io/badge/Angular-19-DD0031?logo=angular) [![License](https://img.shields.io/github/license/falberthen/ecommerceddd.svg)](LICENSE)
8+
9+
![Build](https://github.com/falberthen/ecommerceddd/actions/workflows/ecommerceddd-build.yml/badge.svg) ![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker)
810

9-
![.NET](https://img.shields.io/badge/.NET-10-512BD4?logo=dotnet) ![Angular](https://img.shields.io/badge/Angular-19-DD0031?logo=angular) ![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker)
10-
![Build](https://github.com/falberthen/ecommerceddd/actions/workflows/ecommerceddd-build.yml/badge.svg)
11-
[![License](https://img.shields.io/github/license/falberthen/ecommerceddd.svg)](LICENSE)
1211
<br/>
1312

1413
<p align="center">
@@ -113,7 +112,7 @@ Microservices communicate directly using **Kiota-generated typed HTTP clients**.
113112
|------------|---------|
114113
| .NET | 10 |
115114
| C# | 12 |
116-
| Koalesce.OpenAPI | 1.0.0-alpha.12 |
115+
| Koalesce | 1.0.0-beta.5 |
117116
| Ocelot | 24.1.0 |
118117
| Marten | 8.19.0 |
119118
| Confluent Kafka | 2.13.0 |
@@ -143,29 +142,37 @@ Microservices communicate directly using **Kiota-generated typed HTTP clients**.
143142

144143
### Running with Docker
145144

145+
**Backend only** — starts all microservices, databases, Kafka, and infrastructure:
146+
147+
```bash
148+
docker compose up
149+
```
150+
151+
**Backend + Frontend** — also builds and serves the Angular SPA at `http://localhost:4200`:
152+
146153
```bash
147-
# Start all services
148-
docker-compose up
154+
docker compose --profile frontend up
149155
```
150156

151157
> 💡 **Tip:** You can also set `docker-compose.dcproj` as the startup project in Visual Studio for debugging.
152158
153159
<br/>
154160

161+
### Running the SPA locally (with hot-reload)
155162

156-
### Running the Angular SPA
163+
If you prefer running the frontend outside Docker for development, start the backend with `docker compose up`, then:
157164

158165
```bash
159-
cd EcommerceDDD.Spa
166+
cd src/EcommerceDDD.Spa
160167
npm install
161168
ng serve
162169
```
163170

164-
Open your browser at `http://localhost:4200`
171+
The app will be available at `http://localhost:4200`.
165172

166173
<br/>
167174

168-
### Regenerating Kiota Clients
175+
### Advanced: Regenerating Kiota Clients
169176

170177
If you want to regenerate all typed HTTP clients, after containers are running:
171178

0 commit comments

Comments
 (0)