Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

40 lines
1.6KB

  1. #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
  2. FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS base
  3. USER app
  4. WORKDIR /app
  5. FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
  6. ARG BUILD_CONFIGURATION=Release
  7. WORKDIR /src
  8. COPY ["TelpoPush.Worker.ThirdSsl/TelpoPush.Worker.ThirdSsl.csproj", "TelpoPush.Worker.ThirdSsl/"]
  9. COPY ["TelpoPush.Common/TelpoPush.Common.csproj", "TelpoPush.Common/"]
  10. COPY ["TelpoPush.Models/TelpoPush.Models.csproj", "TelpoPush.Models/"]
  11. COPY ["TelpoPush.Service/TelpoPush.Service.csproj", "TelpoPush.Service/"]
  12. COPY ["nuget.config","."]
  13. RUN dotnet nuget remove source nuget.org
  14. RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget
  15. RUN dotnet restore "./TelpoPush.Worker.ThirdSsl/TelpoPush.Worker.ThirdSsl.csproj"
  16. COPY . .
  17. WORKDIR "/src/TelpoPush.Worker.ThirdSsl"
  18. RUN dotnet build "./TelpoPush.Worker.ThirdSsl.csproj" -c $BUILD_CONFIGURATION -o /app/build
  19. FROM build AS publish
  20. ARG BUILD_CONFIGURATION=Release
  21. RUN dotnet publish "./TelpoPush.Worker.ThirdSsl.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
  22. FROM base AS final
  23. WORKDIR /app
  24. COPY --from=publish /app/publish .
  25. COPY pem /app/pem
  26. ENV environment=Development
  27. ENV TimeZone=Asia/Shanghai
  28. ENV LANG C.UTF-8
  29. RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone
  30. #ENTRYPOINT ["dotnet", "TelpoPush.Worker.ThirdSsl.dll"]
  31. ENTRYPOINT ["sh", "-c", "dotnet TelpoPush.Worker.ThirdSsl.dll --environment=$environment"]