简体   繁体   English

尝试在 Docker 容器中运行 .Net Framework Web API

[英]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.

相关问题 我可以进一步减少对由docker容器上的asp.net Web API应用程序运行的docker映像的依赖性 - Can I further reduce dependency on docker images to run by asp.net web api application on docker container .Net Core Web Api至Docker Container Mac - .Net Core Web Api to Docker Container Mac 如何在没有 https 的情况下使用 docker 容器运行 asp.net web api? - How to run asp.net web api with docker container without https? 如何运行已编译的 SPA static 文件以及 ASP.NET 核心 Web API 在 docker 容器中发布? - How to run compiled SPA static files along with ASP.NET Core Web API publish in docker container? web api docker 集装箱 - web api docker container 我可以在 Mac 上的 docker 容器中运行 Visual Studio 和 .Net Framework 吗? - Can I run Visual Studio and .Net Framework in a docker container on Mac? .NET Core Web应用程序无法在Docker容器中运行 - .NET Core web app won't run in Docker container .NET Core 3.0 Web API 不会在 Docker 容器中启动 - .NET Core 3.0 Web API won't start in Docker container 如何在容器中运行 .NET Web API? - How can I run a .NET Web API in a container? 如何在 ZC5FD214CDD0D2B3B4272E73B022 上本地运行 .net 内核 web api? - How to run a .net core web api locally on Docker?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM