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