【问题标题】:Attempting to run .Net Framework Web API in Docker container尝试在 Docker 容器中运行 .Net Framework Web API
【发布时间】:2020-06-08 12:44:54
【问题描述】:

我尝试在 Docker 中运行一个 .NET Framework 4.6.2 Web API。

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

除了 404 之外,我似乎无法从该站点获得任何响应。除了发布 80 端口我还需要做其他配置吗?

我已经能够让一个典型的网站运行没有问题,但由于某种原因而不是一个 web api。

【问题讨论】:

  • 你解决了吗?

标签: docker asp.net-web-api .net-4.6.2


【解决方案1】:

也许必须将卷设置为根文件夹 DoctorPortalAPI

  • ./DoctorPortalAPI:c:/inetpub/wwwroot

这允许 web.config 在容器内可见。

【讨论】:

    猜你喜欢
    • 2023-01-20
    • 2021-10-26
    • 1970-01-01
    • 2020-04-22
    • 2017-10-30
    • 1970-01-01
    • 1970-01-01
    • 2023-01-25
    • 2018-08-30
    相关资源
    最近更新 更多