Hello .NET¶
A minimal ASP.NET Minimal API application in C#. Multi-stage Docker build with .NET SDK and ASP.NET runtime. One container, one service, no database, no cache.
Overview¶
| Repository | git@gitlab.com:appmecca-sample-apps/hello-dotnet.git |
| Tech Stack | .NET 9 / ASP.NET Minimal API |
| Services | web (port 8080) |
| Database | None |
| Cache | None |
| URL Pattern | https://hello-dotnet-web.{env}.appmecca.net |
What This App Demonstrates¶
- Deploying a C# / .NET application on AppMecca
- Multi-stage Docker build (.NET SDK + ASP.NET runtime)
- ASP.NET Minimal APIs (simplest .NET web pattern)
- Health check endpoint pattern
appmecca.yaml¶
containers:
- name: hello-dotnet
dockerfile: Dockerfile
context: .
deploy:
- name: web
container: hello-dotnet
port: 8080
health_check:
path: /health
The configuration is identical in structure to any other single-container app. ASP.NET is configured to listen on port 8080.
Step-by-Step Deployment¶
1. Register the app¶
2. Build the container¶
Expected output
3. Deploy¶
Expected output
4. Verify¶
Test the endpoint:
Key Concepts¶
Multi-stage Docker builds for .NET¶
The first stage uses the .NET SDK to restore packages, compile, and publish the application. The second stage uses the ASP.NET runtime image (Alpine-based), which is much smaller. The final image contains only the compiled DLLs and the runtime.
ASP.NET Minimal APIs¶
Minimal APIs are the lightest way to build HTTP services in .NET. The entire application is defined in a single Program.cs file -- no controllers, no startup classes, just inline route handlers. This makes them ideal for microservices.
Any language, same workflow
AppMecca does not care what language your application is written in. As long as your container listens on the declared port and responds to health checks, the deployment workflow is identical.
What's Next?¶
- Hello Flask -- see the same pattern in Python
- Hello Java -- see the same pattern in Java
- Hello Rust -- see the same pattern in Rust
- App with Database -- add PostgreSQL to your application