[英]Attempting to run .Net Framework Web API in Docker container
I have a .NET Framework 4.6.2 Web API I am trying to run in Docker.我有一个 .NET Framework 4.6.2 Web API,我想在 Docker 中运行。
docker-compose.yml docker-compose.yml
version: "3.7"
services:
doctorportalapi:
image: mcr.microsoft.com/dotnet/framework/aspnet:4.6.2-20200211-windowsservercore-ltsc2016
container_name: frameworkapi
ports:
- "80:80" # expose 38419 on host and sent to 80 in container
- "443:443" # expose 38419 on host and sent to 80 in container
#volumes:
- ./DoctorPortalAPI/bin:c:/inetpub/wwwroot
I can't seem to get any response other than 404 from the site.除了网站的 404 之外,我似乎无法得到任何响应。 Is there any other configuration I need to do besides publishing port 80?
除了发布端口 80 之外,我还需要做其他配置吗?
I've been able to get a typical website running no problem but not a web api for some reason.由于某种原因,我已经能够让一个典型的网站正常运行,但不能运行 web api。
Maybe the volume must be set to root folder DoctorPortalAPI也许卷必须设置为根文件夹 DoctorPortalAPI
- ./DoctorPortalAPI:c:/inetpub/wwwroot
./DoctorPortalAPI:c:/inetpub/wwwroot
This allows the web.config is visible inside the container.这允许 web.config 在容器内可见。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.