Skip to main content
The AspNetRun microservices application is fully containerized using Docker, enabling consistent deployment across different environments. The application uses Docker Compose to orchestrate multiple containers including databases, message brokers, caching, and application services.

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:
  1. base - Runtime stage using mcr.microsoft.com/dotnet/aspnet:8.0
  2. build - SDK stage using mcr.microsoft.com/dotnet/sdk:8.0 for compilation
  3. publish - Publish stage creating optimized release builds
  4. final - Final minimal runtime image
This approach minimizes image size and improves security by excluding build tools from production images.

Volume Management

Persistent volumes ensure data survives container restarts:
  • postgres_catalog - Catalog database data
  • postgres_basket - Basket database data
  • SQL Server and Redis data stored in container volumes

Quick Start

# Build and start all services
docker-compose up -d

# View running containers
docker-compose ps

# View logs for all services
docker-compose logs -f

# Stop all services
docker-compose down

Access Points

Once running, services are available at:

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

Build docs developers (and LLMs) love