This is a simple Asp.net Core 2.0 Demo Application that can show your;
- Connection Info
- Request Headers
- Environment Variables
Also contains Dockerfile and Multistage Build.
It is just for testing purposes.
Startup.cs is like;
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.All,
RequireHeaderSymmetry = false,
ForwardLimit = null
});
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
app.UseHttpMethodOverride();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
It means forwards (for loadbalancer etc.) and method overrides will work without any configuration.
# It will build your Docker Image from your Dockerfile
# And will name it aspnetcore-demo
docker build -t aspnetcore-demo .
# It will run your Docker Image named by aspnetcore-demo
# Will give the port 4455 for testing on your http://localhost:4455 address
# And will name your container as aspnetcore-demo
docker run -p 4455:80 --name aspnetcore-demo aspnetcore-demo
If you think we should add more something on this repository, feel free to PR 😊
Thank you for using and contributing...