如何使用Azure CI-CD管道将ASP.Net docker容器化应用程序部署到本地服务器?

时间:2020-10-23 21:22:19

标签: docker-compose azure-devops

我正在运行一个多层Asp.Net应用程序。由于它具有多层特性,因此我必须为其构建一个容器并将其部署为容器。

我是否可以使用Azure-Pipelines将其部署到现有服务器上?

我在网上找到的所有其他支持都与部署到Azure App Services有关,但是我想部署到现有的生产环境。

1 个答案:

答案 0 :(得分:0)

我是否可以使用Azure-Pipelines将其部署到现有服务器上?

由于要部署到本地环境,因此可以使用Self-hosted Agent(构建管道和发布管道)或Deployment Group(发布管道)。

然后,您可以尝试以下管道设置。

enter image description here

这是一个有关ASP.Net Application Deployment in Docker for Windows的博客。

您可以使用 const App = require(`${process.cwd()}/dist/server/${pageName}.bundle.js`).default; const sheet = new ServerStyleSheet(); const content = renderToString(sheet.collectStyles(<App />)); const styleTags = sheet.getStyleTags(); 运行docker命令。在这种情况下,您可以将本地构建和部署过程移到天蓝色的devops

顺便说一句,如果您在Azure Devops中拥有Container registry Service connection,则可以使用Docker taskDocker Compose task

相关问题