feat: 添加打包配置

develop
zhangyousheng 2023-07-30 16:37:08 +08:00
parent 9a437352d6
commit 71e9a40c07
4 changed files with 39 additions and 0 deletions

25
Dockerfile 100644
View File

@ -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"]

6
NuGet.Config 100644
View File

@ -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>

1
README.md 100644
View File

@ -0,0 +1 @@
## 会员积分管理系统

View File

@ -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