From 8695b0951341f213400b9800d775ecc12722b386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Tue, 26 Aug 2025 19:16:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=86=B3=20?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= 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