Architecture Components
The Docker setup consists of three main categories of services:Infrastructure Services
- catalogdb - PostgreSQL database for catalog service
- basketdb - PostgreSQL database for basket service
- orderdb - SQL Server database for ordering service
- distributedcache - Redis cache for session and data caching
- messagebroker - RabbitMQ for asynchronous messaging
Application Services
- catalog.api - Product catalog management (Port 6000/6060)
- basket.api - Shopping basket management (Port 6001/6061)
- discount.grpc - Discount service with gRPC (Port 6002/6062)
- ordering.api - Order processing (Port 6003/6063)
Gateway & Frontend
- yarpapigateway - YARP reverse proxy API gateway (Port 6004/6064)
- shopping.web - Razor Pages web application (Port 6005/6065)
Service Communication
Multi-Stage Docker Builds
All .NET services use multi-stage Dockerfiles based on .NET 8.0:- base - Runtime stage using
mcr.microsoft.com/dotnet/aspnet:8.0 - build - SDK stage using
mcr.microsoft.com/dotnet/sdk:8.0for compilation - publish - Publish stage creating optimized release builds
- final - Final minimal runtime image
Volume Management
Persistent volumes ensure data survives container restarts:postgres_catalog- Catalog database datapostgres_basket- Basket database data- SQL Server and Redis data stored in container volumes
Quick Start
Access Points
Once running, services are available at:- Shopping Web UI: http://localhost:6005
- API Gateway: http://localhost:6004
- RabbitMQ Management: http://localhost:15672 (guest/guest)
- Catalog API: http://localhost:6000
- Basket API: http://localhost:6001
- Discount gRPC: http://localhost:6002
- Ordering API: http://localhost:6003
Prerequisites
- Docker Desktop 20.10 or higher
- Docker Compose v2.0 or higher
- Minimum 8GB RAM allocated to Docker
- Ports 1433, 5432, 5433, 5672, 6000-6065, 6379, 15672 available
Next Steps
Docker Compose
Complete docker-compose configuration reference
Configuration
Environment variables and settings
Networking
Container networking and service discovery
