Nginx + Docker 多阶段构建的部署学习
前几天部署了一个网站,原来我一直是发布完成之后,通过ftp把文件上传上去,有几个大佬给我说了多阶段构建,此时我就不需要发布再搞了,直接将项目添加docker支持。 #See https: // aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com /dotnet/core/aspnet: 3.1 -buster-slim AS base WORKDIR / app EXPOSE 80 FROM mcr.microsoft.com /dotnet/core/sdk: 3.1 - buster AS build WORKDIR / src COPY [ " amusinghoS.App/amusinghoS.App.csproj " , " amusinghoS.App/ " ] COPY [ " amusinghoS.Entity/amusinghoS.EntityData.csproj " , " amusinghoS.Entity/ " ] COPY [ " amusinghoS.Shared/amusinghoS.Shared.csproj "