doc(docker): Add docker support file
This commit is contained in:
parent
8135b7ab17
commit
d32d415092
|
@ -0,0 +1,9 @@
|
||||||
|
.dockerignore
|
||||||
|
.env
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.vs
|
||||||
|
.vscode
|
||||||
|
*/bin
|
||||||
|
*/obj
|
||||||
|
**/.toolstarget
|
|
@ -10,12 +10,14 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<DocumentationFile>..\Bootstrap.Admin\Bootstrap.Admin.xml</DocumentationFile>
|
<DocumentationFile>..\Bootstrap.Admin\Bootstrap.Admin.xml</DocumentationFile>
|
||||||
|
<DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.5" />
|
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.5" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.2" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.4.10" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" PrivateAssets="All" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
|
||||||
|
#For more information, please see https://aka.ms/containercompat
|
||||||
|
|
||||||
|
FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803 AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
FROM microsoft/dotnet:2.2-sdk-nanoserver-1803 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["Bootstrap.Admin/Bootstrap.Admin.csproj", "Bootstrap.Admin/"]
|
||||||
|
COPY ["Bootstrap.DataAccess/Bootstrap.DataAccess.csproj", "Bootstrap.DataAccess/"]
|
||||||
|
RUN dotnet restore "Bootstrap.Admin/Bootstrap.Admin.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/Bootstrap.Admin"
|
||||||
|
RUN dotnet build "Bootstrap.Admin.csproj" -c Release -o /app
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "Bootstrap.Admin.csproj" -c Release -o /app
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app .
|
||||||
|
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]
|
|
@ -0,0 +1,20 @@
|
||||||
|
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
|
||||||
|
WORKDIR /app
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
FROM microsoft/dotnet:2.2-sdk AS build
|
||||||
|
WORKDIR /src
|
||||||
|
COPY ["Bootstrap.Admin/Bootstrap.Admin.csproj", "Bootstrap.Admin/"]
|
||||||
|
COPY ["Bootstrap.DataAccess/Bootstrap.DataAccess.csproj", "Bootstrap.DataAccess/"]
|
||||||
|
RUN dotnet restore "Bootstrap.Admin/Bootstrap.Admin.csproj"
|
||||||
|
COPY . .
|
||||||
|
WORKDIR "/src/Bootstrap.Admin"
|
||||||
|
RUN dotnet build "Bootstrap.Admin.csproj" -c Release -o /app
|
||||||
|
|
||||||
|
FROM build AS publish
|
||||||
|
RUN dotnet publish "Bootstrap.Admin.csproj" -c Release -o /app
|
||||||
|
|
||||||
|
FROM base AS final
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=publish /app .
|
||||||
|
ENTRYPOINT ["dotnet", "Bootstrap.Admin.dll"]
|
|
@ -23,6 +23,11 @@
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
"applicationUrl": "http://localhost:50852/"
|
"applicationUrl": "http://localhost:50852/"
|
||||||
|
},
|
||||||
|
"Docker": {
|
||||||
|
"commandName": "Docker",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue