microsoft / iis-docker

Dockerfile for IIS
https://hub.docker.com/r/microsoft/iis/
MIT License
293 stars 129 forks source link

Deleting Default Web Site Broke Container #150

Closed josh-mclean closed 7 months ago

josh-mclean commented 5 years ago

We tried deleting as well as stopping the default website via a powershell script ran from our dockerfile.

This resulted in errors on the site and we were unable to get the site working. What is the best practice here? When using the microsoft/iis image are we required to keep the Default Web Site and put our application on it? We were able to get the site working by keeping the Default Web Site and moving our site to port 8080.

Thank you Josh

PixelRobots commented 3 years ago

What I do is:

Set up the application pool if needed and then use the below.

$wwwpath = "sitepath"
$iisObjectName = "sitename"
New-Website -Name $iisObjectName -ApplicationPool $iisObjectName -Force -IPAddress * -PhysicalPath "$wwwpath" -Port 80
Remove-WebSite -Name "Default Web Site"
Start-Website -Name $iisObjectName