From eb1985c7470de25430cee4fd95ffdb5da224218f Mon Sep 17 00:00:00 2001 From: tiananlin Date: Tue, 26 Aug 2025 15:13:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Learn.Archives.API/Dockerf?= =?UTF-8?q?iles/Dockerfile-production?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dockerfiles/Dockerfile-production | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Learn.Archives.API/Dockerfiles/Dockerfile-production diff --git a/Learn.Archives.API/Dockerfiles/Dockerfile-production b/Learn.Archives.API/Dockerfiles/Dockerfile-production new file mode 100644 index 0000000..d7599a1 --- /dev/null +++ b/Learn.Archives.API/Dockerfiles/Dockerfile-production @@ -0,0 +1,15 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish +WORKDIR /src +COPY . . +WORKDIR "/src/Learn.Archives.API" +ENV NUGET_XMLDOC_MODE none +RUN dotnet nuget add source --name marking https://gitea.23544.com/api/packages/marking/nuget/index.json +RUN dotnet publish "Learn.Archives.API.csproj" -c Release -o /app + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final +WORKDIR /app +COPY --from=publish /app . +ENV ASPNETCORE_ENVIRONMENT=Production +ENV TZ=Asia/Shanghai +EXPOSE 8080 +ENTRYPOINT ["dotnet", "Learn.Archives.API.dll"] \ No newline at end of file