Can I run a dotnet application that is hosted in IIS in a docker container?

I developed a web application using asp dotnet, and currently it works for me on IIS, somehow I can run the same application in the docker container,

I am relatively new to Docker, and I played a little and I am familiar with compiling dockers, so I was wondering if I can (pre-rezerezirovat) the application that I developed.

My Dockerfile now looks like this:

#Making a dotnet container
FROM microsoft/dotnet:latest

#Make a directory
WORKDIR /app

#copy dll files and other dependencies
COPY . /app

#dotnet run should run the app
ENTRYPOINT ["DOTNET","RUN"]

From what I understand, this makes a directory inside my dotnet container and copies the files in the current folder, and the application will run in run mode

+4
source share
1

Dockerfile, :

#Making a dotnet container
FROM microsoft/iis

SHELL ["powershell"]

RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \  
    Install-WindowsFeature Web-Asp-Net45

RUN Remove-WebSite -Name 'Default Web Site'  
RUN New-Website -Name 'app' -Port 80 \  
    -PhysicalPath 'c:\app' -ApplicationPool '.NET v4.5'

#copy dll files and other dependencies
COPY app app

#dotnet run should run the app
CMD ["ping", "-t", "localhost"]  

docker build -t app .  
docker run --name app -d -p 80:80 app
docker inspect --format="{{.NetworkSettings.Networks.nat.IPAddress}}" app

ip, .

: IIS + ASP.NET Windows 10 Docker

+1

Source: https://habr.com/ru/post/1654036/


All Articles