Skip to content
bitzorcas
中EN

Recipe

Practical Guide: Local Infrastructure & .NET Aspire Orchestration

Master local development orchestration in BitzOrcas.Modern: .NET Aspire AppHost, SQL Server 2022, Redis 7, MinIO containers, verified port matrices, volume persistence, and database schema reset.

Last updated

To free onboarding developers from the nightmare of multi-day environment setup, BitzOrcas.Modern adopts .NET Aspire AppHost as the primary local development entrypoint. Instead of manually configuring local SQL Server or Redis instances, a single command orchestrates production-aligned container topologies and application services inside Docker.

Local Aspire Orchestration Topology & Ports

.NET Aspire AppHost (Unified Dashboard)

BitzOrcas.Gateway (YARP Gateway :6880)

BitzOrcas.Api (Core Minimal API :6881 HTTP / :6883 HTTPS)

Web Admin (React SPA :5860)

SQL Server 2022 Container (Host Port :14333)

Redis 7 Container (DCP Dynamic / Default :6379)

MinIO Object Storage (API :9000, Console :9001)


Verified Port Mapping & Service Matrix

The authoritative source of truth for ports is src/Hosts/BitzOrcas.AppHost/LocalDevPorts.cs and each project’s launchSettings.json. AppHost pins only two host ports: SQL Server 14333 and the orchestrator frontend 5860. All other backing resources are assigned dynamically by Aspire DCP or bound via configuration:

Service NameHost Access URLFunctional Purpose
Aspire DashboardSee terminal output URLUnified OpenTelemetry dashboard: container health, live logs, distributed tracing, and metrics (OTLP 16175, Resource Service 17037)
YARP Gatewayhttp://localhost:6880Reverse proxy and unified routing gateway
API Hosthttp://localhost:6881
https://localhost:6883
Core Minimal API host; OpenAPI documentation at /scalar/v1
Web Admin Consolehttp://localhost:5860React 19 + Vite local development hot-reload server
SQL Server 2022localhost,14333Pinned port for AppHost persistence; user sa, password passed via env vars, non-conflicting with Compose port 1433
Redis 7Dynamic DCP port / default 6379Injected via Aspire connection strings; fixed at localhost:6379 under Docker Compose
MinIO Object StorageDynamic DCP port / default 9000S3-compatible object storage API and web management console

Development Execution & Volume Persistence Patterns

During regular development iterations, database state should persist across machine restarts to prevent repetitive database seeding:

Start AppHost with persistent volume mode
# Export persistence environment variables and launch the orchestration
ASPIRE_PERSIST_SQLSERVER=true ASPIRE_PERSIST_MINIO=true dotnet run --project src/Hosts/BitzOrcas.AppHost

2. Database Schema Reset: Zero-Friction Re-initialization

When local testing produces corrupted test data or upstream migrations introduce breaking schema changes, trigger a clean wipe and re-seed:

Wipe local database and re-seed clean baseline
# Force full schema wipe and re-run seed data contributors
BITZORCAS_ASPIRE_RESET_SCHEMA=true dotnet run --project src/Hosts/BitzOrcas.AppHost

Troubleshooting & Common Local Failures

  1. Port Conflicts (14333, 6880, or 6881 already in use):
    • Check if an orphaned Docker container or local physical SQL Server / IIS process is already running;
    • Run lsof -i :14333 or lsof -i :6880 on macOS/Linux to identify and terminate conflicting PIDs.
  2. Docker Desktop Resource Starvation:
    • The SQL Server 2022 container requires at least 2 GB of memory allocated to Docker. We recommend allocating 4 GB or more in Docker Desktop settings;
    • On Apple Silicon (M1/M2/M3/M4) Macs, ensure Rosetta 2 emulation is enabled in Docker Desktop settings to ensure fast emulation for linux/amd64 images.

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%