SOLIDSoftworks / dotnet-framework-docker-environment-override

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Override web.config sections with environment variables

Most of the heavy lifting is done in the configuration builder with some configuration being done in the web.config.

Try it out

First, try running the WebSite project normally in Visual Studio. You can check out the configuration and try changing some values in the custom configuration section (<website>...</website>). You'll see information being put in the footer, external links being put in the navbar, and the name of the application changing.

Now run it in docker

$ docker build --rm -t solid/docker-demo-site -f WebSite/Dockerfile .
$ docker run -d --rm -p 8080:80 `
  -e ASPNET__website__name='Dockerized' `
  -e ASPNET__website__container__name='solid/docker-demo-site' `
  -e ASPNET__website__externalLinks__link[1]__name='Solid softworks' `
  -e ASPNET__website__externalLinks__link[1]__url='https//solidsoft.works' `
  solid/docker-demo-site

Read more

We blogged about this.

About

License:MIT License


Languages

Language:JavaScript 83.6%Language:C# 13.0%Language:Csound Document 1.5%Language:HTML 1.3%Language:Dockerfile 0.3%Language:CSS 0.2%Language:ASP 0.0%