feat: 添加打包配置
parent
9a437352d6
commit
71e9a40c07
|
|
@ -0,0 +1,25 @@
|
|||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
|
||||
WORKDIR /docker
|
||||
EXPOSE 5000
|
||||
|
||||
FROM mcr.microsoft.co/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
RUN dotnet restore src/UserPointManagement.Web/UserPointManagement.Web.csproj --configfile ./NuGet.Config
|
||||
WORKDIR src/UserPointManagement.Web
|
||||
RUN dotnet build UserPointManagement.Web.csproj -c Release
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish UserPointManagement.Web.csproj -c Release -o /app
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
|
||||
ENV ASPNETCORE_URLS http://*:5000
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
ENTRYPOINT ["dotnet", "UserPointManagement.Web.dll"]
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
|
@ -18,6 +18,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserPointManagement.Persist
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserPointManagement.Application.Tests", "test\UserPointManagement.Application.Tests\UserPointManagement.Application.Tests.csproj", "{5770D3E5-9B3E-40FC-8209-62F0B4B45BD4}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{08F901D9-600A-4B4D-A942-AD2F61EDFE49}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Dockerfile = Dockerfile
|
||||
README.md = README.md
|
||||
NuGet.Config = NuGet.Config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
|
|||
Loading…
Reference in New Issue